GNOME Bugzilla – Bug 750343
CSD enabled unconditionally for windows with titlebar
Last modified: 2018-05-02 16:36:53 UTC
Quoting Emmanuele: "The change in 03213b9509fc1df16c66194ea168aed6c15110e9 changed the rules as to when CSD can be enabled, but it also unconditionally enables CSD with the implicit assumption that client-side shadows were the real issue, and that we could work around that by drawing our own borders. This also means that setting a titlebar for a GtkWindow will enable CSD unconditionally. In reality, some window managers (like Matchbox) *only* support server-side decorations, and will ignore all hints to the contrary, to the point of drawing decorations at random locations on top of the window." (it's not actually window decoration but a panel that draws where the WM believes is a good spot to draw on top of the SSD titlebar, but the end result is the same) I'll let ebassi attach the patch himself. I've tested it and it works for me. We can patch it in yocto as well if it doesn't seem appropriate here: I realise the use case is a bit obscure and the solution is still band-aid over WM problems.
Created attachment 304516 [details] [review] window: Check if we can use CSD before enabling them The change in 03213b9509fc1df16c66194ea168aed6c15110e9 changed the rules as to when CSD can be enabled, but it also unconditionally enables CSD with the implicit assumption that client-side shadows were the real issue, and that we could work around that by drawing our own borders. This also means that setting a titlebar for a GtkWindow will enable CSD unconditionally. In reality, some window managers (like Matchbox) *only* support server-side decorations, and will ignore all hints to the contrary, to the point of drawing decorations at random locations on top of the window. Since CSD are enabled unconditionally, the GTK_CSD environment variable is also not a suitable escape hatch. In the grand tradition of asking ourselves if we should do something just because we can, we should split the environment checks from the checks on what the user requested; by doing that, we can also check when enabling client-side decorations, and ideally bail out if needed.
Review of attachment 304516 [details] [review]: ok
Attachment 304516 [details] pushed as c5e5ee6 - window: Check if we can use CSD before enabling them The result is not spectacular, but at least it shouldn't be any more broken.
Had to revert commit c5e5ee6 as it pretty spectacularly broke the default sizing of empty GtkWindows, as well as exposed a bunch of invalid sizing inside GtkWindow.
I've opened bug 751341 with a potential fix for the default size issue. On the reverted patch: It also has the side effect that normal windows without a manually set header bar use CSD while they didn't before. Is this really on purpose?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/557.