After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747688 - Improve theming of windows under the no-compositor/no-client side shadows case
Improve theming of windows under the no-compositor/no-client side shadows case
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Themes
3.16.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-04-11 11:14 UTC by Bazon
Modified: 2017-10-06 13:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bazon 2015-04-11 11:14:06 UTC
Since the update to Gnome 3.16, Gnome windows are surrounded by rectangular frames when run in other Desktop Environments than Gnome-Shell such as XFCE4 (yes, with compositor enabled) and KDE. 
(Or in XFCE4 with kwin as window-manager, which I use normally.)

As I found out and will show later, this is caused by gtk3 3.16.

For example:
This is how nautilus 3.16 looks like in XFCE4 with gtk3 3.16:
http://i.imgur.com/B6A6aBt.png

The size and color of the frame depends on the selected GTK-theme. In case of the screenshot above, the "Adwaita-Manjaro-dark" theme was used.
With the default Adwaita GTK-theme, the frame is thinner and white:
http://i.imgur.com/OwKyu8z.png

As this frame is better seen with the Adwaita-Manjaro-dark theme, I'll stick with that theme for the next screenshots.

To prove it doesn't depend on nautilus 3.16, here is nautilus 3.14 with gtk3 3.16, still with that frame:
http://i.imgur.com/rV7yHZg.png

And it's not only nautilus, it's literally all Gnome-Applications like gedit, gnome-calculator, file-roller, evince, totem, ...
...all are surrounded by that frame in other Desktop Environments.
Here is file-roller with gtk3 3.16 as a prove:
http://i.imgur.com/l2Ukwph.png

Downgrading to gtk3 3.14, all this frame-problems are gone.
E.g. with nautilus 3.14 (3.16 doesn't start):
http://i.imgur.com/lJ6OB5A.png

Everything al right. 
(Totem had to be downgraded to 3.14, too, other Gnome-Applications didn't need to be downgraded.)



Maybe helpful: terminal output when starting nautilus 3.16 with gtk3 3.16 in XFCE:

$ nautilus

(nautilus:3652): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2:19: Theming engine 'adwaita' not found

(nautilus:3652): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
Initializing nautilus-dropbox 2.10.0
<IntrospectionModule 'Nautilus' from '/usr/lib/girepository-1.0/Nautilus-3.0.typelib'>
Insync Nautilus Plugin
<class 'insync_plugin.InsyncExtension'>
Socket: /run/user/1000/ownCloud/socket <=> /ownCloud/socket
Socket File: /run/user/1000/ownCloud/socket
Setting connected to True
Socket watch id: 16
('[__init__ insync plugin]', <InsyncExtension object at 0x7f349237bd70 (uninitialized at 0x0)>)
sys:1: Warning: The property GtkSettings:gtk-button-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
sys:1: Warning: The property GtkSettings:gtk-menu-images is deprecated and shouldn't be used anymore. It will be removed in a future version.


terminal output when starting nautilus 3.14 with gtk3 3.14 without the frame-problem:

$ nautilus

(nautilus:5174): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2:19: Theming engine 'adwaita' not found

(nautilus:5174): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
Initializing nautilus-dropbox 2.10.0
ImportError: No module named Nautilus

(nautilus:5174): Nautilus-Python-WARNING **: nautilus_python_init_python failed

(nautilus:5174): GLib-GObject-WARNING **: The property GtkSettings:gtk-button-images is deprecated and shouldn't be used anymore. It will be removed in a future version.

(nautilus:5174): GLib-GObject-WARNING **: The property GtkSettings:gtk-menu-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
Comment 1 Bazon 2015-04-11 11:19:29 UTC
PS:
I'm using arch linux with Linux 3.19.3-3-ARCH. This frame-problem occurred on all my computers with different hardware, especially different graphics hardware. (intel and ATI.)
Comment 2 Emmanuele Bassi (:ebassi) 2015-04-11 11:23:30 UTC
> (nautilus:3652): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:2:19: Theming engine 'adwaita' not found

It seems you're running with a broken, older theme.

Since GTK+ 3.14, the Adwaita theme is shipped by GTK+ itself, and does not use any engine. The theme is also responsible for drawing the shadows in client-side windows, which would probably result in a black background instead of a shadow in a composited environment.

You should look in /usr/share/themes and $HOME/.local/share/themes if you have an older copy of the Adwaita theme; any Adwaita directory should contain a gtk-3.0/gtk.css file, that only says:

/* Adwaita is the default theme of GTK+ 3, this file is not used */

If the gtk-3.0 directory contains anything else, or the file contains anything else, then you're running with an older copy of Adwaita.
Comment 3 Bazon 2015-04-11 12:22:22 UTC
$HOME/.local/share/: 
no "themes" directory at all.

/usr/share/themes/Adwaita/gtk-3.0/:
gtk.css is the only file inside that directory, its content:
"/* Adwaita is the default theme of GTK+ 3, this file is not used */"

So just as you said, seems to match. 
So it seems I'm not using an old version of Adwaita.
(Adwaita-Manjaro-dark is old, OK.)

So is this (nautilus 3.16, gtk3 3.16, with the default Adwaita theme)
http://i.imgur.com/OwKyu8z.png
really what it is supposed to look like?
IMHO, although the frame is thinner with the default and new Adwaita, it's still clearly visible and the sharp corners don't look very good. 
It really looked better in 3.14.
Comment 4 Emmanuele Bassi (:ebassi) 2015-04-11 12:31:33 UTC
(In reply to Bazon from comment #3)
> $HOME/.local/share/: 
> no "themes" directory at all.
> 
> /usr/share/themes/Adwaita/gtk-3.0/:
> gtk.css is the only file inside that directory, its content:
> "/* Adwaita is the default theme of GTK+ 3, this file is not used */"
> 
> So just as you said, seems to match. 
> So it seems I'm not using an old version of Adwaita.

It seems you are, because there is no gtk-widget.css anywhere near Adwaita, and there hasn't been for two release cycles, so there's no reason for GTK+ to display a warning mentioning it, or the inability to load an "adwaita" engine.

> So is this (nautilus 3.16, gtk3 3.16, with the default Adwaita theme)
> http://i.imgur.com/OwKyu8z.png
> really what it is supposed to look like?

It's what it's supposed to like if there is no compositing enabled, or the compositor does not support client-side shadows via the '_GTK_FRAME_EXTENTS' WM hint.

> IMHO, although the frame is thinner with the default and new Adwaita, it's
> still clearly visible and the sharp corners don't look very good. 
> It really looked better in 3.14.

In 3.14 we had other failures on similar window managers, which made us fairly conservative on negotiating capabilities on X11, at the request of the maintainers of other environment.

We can definitely improve the theming in the 'no client-side shadows' supported case.
Comment 5 Emmanuele Bassi (:ebassi) 2015-04-11 12:33:48 UTC
Adding Lapo to the Cc: list.
Comment 6 Bazon 2015-04-11 13:10:56 UTC
OK, found out more:

This doesn't happen in XFCE when XFCEs window-manager xfwm4 is started before the Gnome-Applications. 
(And not with "xfwm4 --replace" as I did running kwin as window-manager before.)
Sorry about that.


Still, it happens with KDE with standard window-manager kwin!
(Or, my case: In XFCE with kwin.)


And kwin does in fact support compositing! kwins composite effects are working for me apart the Gnome-window-frames.
So gtk3 3.16 seems to have broke some kind of connection to the way, kwin uses compositing?


(and the "gtk-widget.css" error when starting nautilus was caused by me using the in fact old Adwaita-Manjaro-dark theme.)


So IMHO:
There still seems to be a window-frame-problem WITH compositing enabled in the case of kwin as a window-manager.
(Of course this is low priority as gnome-Apps are not supposed to run in KDE or with the KDE window-manager kwin...)
Comment 7 Jasper St. Pierre (not reading bugmail) 2015-04-12 15:37:55 UTC
Right. So requiring compositing isn't 100% of the story.

In order to get shadows and resizable borders that extend outside of the visible window, we need support of the window manager. Otherwise, when dragging the window around, tiling or maximizing, the window will catch on the wrong spot, or similar results. This is the _GTK_FRAME_EXTENTS hint.

We check that 1) a compositor is available, and 2) the _GTK_FRAME_EXTENTS hint exists, which we check once when the application starts up. The check was less strict in past, and we've been bouncing back and forth trying to support all systems, but sometimes things slip by our test matrix.

In the past year, XFCE added support for _GTK_FRAME_EXTENTS: http://git.xfce.org/xfce/xfwm4/commit/?id=41d20680e6fc9da40560f906e15c1200de8189f2

So this is why things look better under XFWM4.

I was told that KDE recently started _GTK_FRAME_EXTENTS, but it seems that update hasn't reached you yet. We'll still continue to make GTK+3's themeing better under WMs without this support.
Comment 8 Matthias Clasen 2015-04-13 12:24:06 UTC
(In reply to Bazon from comment #0)
 
> The size and color of the frame depends on the selected GTK-theme. In case
> of the screenshot above, the "Adwaita-Manjaro-dark" theme was used.
> With the default Adwaita GTK-theme, the frame is thinner and white:
> http://i.imgur.com/OwKyu8z.png

This is the intended look we were going for here, in environments where we can't do invisible borders and shadows. We show a visible border that lets you resize the window.

Third-party themes will need slight adjustments to handle this new case.
Comment 9 Simonas Kazlauskas 2015-04-16 20:40:43 UTC
Matthias Clasen, is there a way to disable this intended look, perhaps by adding some kind of user-style?

xmonad does not support resizing in that click and drag way, so these borders are useless to me.
Comment 10 Matthias Clasen 2015-04-17 01:42:43 UTC
(In reply to Simonas Kazlauskas from comment #9)
> Matthias Clasen, is there a way to disable this intended look, perhaps by
> adding some kind of user-style?
> 
> xmonad does not support resizing in that click and drag way, so these
> borders are useless to me.

Its all part of the theme. You can adjust the settings for

.window-frame.solid-csd
Comment 11 Daniel Boles 2017-10-06 13:29:21 UTC
resolving as obsolete, unless anyone points out some up-to-date issue.