Comment 11 for bug 1599453

Revision history for this message
Braden Kelley (redbmk) wrote : Re: [Bug 1599453] Re: transparency does not work in gtk3

The BEM methodolgy (https://en.bem.info/) seems to be gaining popularity.
Might have classes like .terminator-terminal__window--transparent or
whatever. That would help ensure classes are clear and unique, although
verbose. At this point though, probably just changing it to
.terminator-terminal-window would be fine as it could be changed in the
future if you decide to write the whole styling in CSS.

It looks like the "opacity" CSS property is supported, but it doesn't work
the same way. In my case the background is black and the foreground goes
invisible - so at 0 opacity the whole window is just black, and at 0.5
opacity the foreground can only be partially seen - you still don't see
through the window to anything below. I think this is because all the child
elements inherit the opacity of the parent (
https://developer.mozilla.org/en-US/docs/Web/CSS/opacity) - but regardless,
the background of the window is still opaque.

In browsers if a property isn't supported it is just ignored. I'd assume it
works the same here, so if rgba isn't supported it should just revert to
the default. For example, you could set 'background-color: rgb(...);
background-color: rgba(...);' and if rgba is supported it would use that,
otherwise it would use the rgb. If you don't have the first declaration it
would just use whatever is the default. I don't know how to go about
testing this though, since transparency is supported on my machine. AFAIK
there's no way to set just the alpha part of a background-color.

On Thu, Jul 7, 2016 at 4:45 PM Stephen Boddy <email address hidden>
wrote:

> Cool. I'm a bit busy to give it a thorough test right now, so perhaps
> later.
>
> Yes, the constantly changing set of deprecations and new/different ways
> of doing things is a bloody annoying source of frustration with GTK. It
> may make perfect sense but it means extra overhead trying to figure out
> how to do things out all over again.
>
> Never, ever apologize when you post multiple messages showing your
> working, especially when you come up with fixes. It educates everyone,
> including me :-)
>
> I see you found a bit of CSS I used to fix the splitter sizes in GTK 3.
> Nice neat looking patch you've added. The Preferences window going
> transparent is understandable, as it is not a modal dialog or anything,
> just a bog standard GtkWindow, so if you set the style on that class, the
> Preferences window would also inherit it, and hence the transparency.
> (Probably also the Custom Commands plugin prefs window too.) But you've
> figured out the right way to fix it with the assigned custom class. Two
> things I might suggest:
>
> 1. A more specific classname. I'm thinking of the future where the whole
> interface is themed using css, and there are stylings defined in the GTK
> themes related to terminals (i.e. gnome-terminal). Maybe we would want
> to follow that generic scheme, and that name would conflict. I'm not
> sure how the CSS hierarchy works, but I think it might end up looking
> something like:
>
> .gnome-terminal-window .terminator-terminal-window
>
> This is all currently conjecture and guess work, so ignore the hierarchy
> stuff for now, but maybe the class name can be changed to terminator-
> terminal-window? What do you think?
>
> 2. Is there a CSS property that just changes the opacity/alpha? If
> compositing is not working then your RGBA would override the theme, and
> the background would be black. If the theme uses padding/spacing around
> widgets this would be visible and probably ugly.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1599453
>
> Title:
> transparency does not work in gtk3
>
> Status in Terminator:
> Incomplete
>
> Bug description:
> Despite the code setting the alpha properly, transparency does not
> work for me in the GTK3 branch.
>
> Changing the transparency setting makes no difference on my terminal,
> running from the tip of the gtk3 branch. It works fine in the GTK2
> version, installed from apt-get.
>
> I'm using Ubuntu GNOME 16.04 with gtk v3.0, libvte v2.91 on a Yoga 3
> Pro. Graphics card is "VGA compatible controller: Intel Corporation
> Broadwell-U Integrated Graphics" with just the standard drivers that
> came with Ubuntu.
>
> I've attached two configs with logs associated with each one:
> 1) the default layout has a single profile, which has transparency
> turned on, titlebar off, and scrollbar turned off.
> 2) the default layout has three profiles displayed.
> 2a) The first is the same as in #1, with transparency turned on.
> 2b) Next to it is a profile with transparency turned off, and with the
> titlebar on and scrollbar on the right.
> 2c) Below both is a profile with transparency turned on higher, with a
> titlebar, and with the scrollbar on the left.
>
> I'm playing around with the code trying to see if I can find a fix
> that will work for me. So far I haven't found anything that doesn't
> break something else.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/terminator/+bug/1599453/+subscriptions
>