Created attachment 110086 [details] Mentioned GTK3 applications shown without decorations Unlike the official Gnome GTK3 applications that have decorations when started with GDK_BACKEND=wayland, most, if not all, other GTK3 applications do not have decorations at all. Examples include Libreoffice (using the GTK3 VCL backend), DarkTable, RawTherapee, MyPaint, and so on. On Weston, these applications all have decorations as expected.
Created attachment 110088 [details] Mentioned GTK3 applications shown with decorations in Weston The applications have decorations in Weston.
The application explicitly requests to have no decoration. This is from WAYLAND_DEBUG output for libreoffice: [306590.176] -> wl_compositor@4.create_surface(new id wl_surface@33) [306590.216] -> org_kde_kwin_server_decoration_manager@15.create(new id org_kde_kwin_server_decoration@34, wl_surface@33) [306590.227] -> org_kde_kwin_server_decoration@34.request_mode(1) The 1 means: "Client-side decoration: The decoration is part of the surface and the client." If the application uses that it's the responsibility of the application to provide the decoration.
So... where to now? Is there a way to force CSD borders somehow, because Weston provides them. Maybe I should open another bug, but worded differently, to reflect that they're specifically lacking KWin decorations, but should have them like other windows? If the applications request no decorations, how does Weston and Mutter give them their CSD decorations? What sort of logic is going on here? Do the official Gnome GTK3 apps that have CSD decorations also request no decorations?
You need to report to GTK. Client side decoration means the application draws it. GTK gained support for our protocol to decide whether to use client or server side decoration. Weston does not support this, so there GTK draws client side decorations. I don't understand why it is not working. But it's a bug in GTK.
*** Bug 389393 has been marked as a duplicate of this bug. ***
Martin, Gnome, in the latest GTK+3 release, they added support for detecting if KWin was running as the compositor and allowing CSD apps to prefer SSD decorations instead. This was the bug report, which has been fixed: https://bugzilla.gnome.org/show_bug.cgi?id=781909 This was their implementation: https://github.com/GNOME/gtk/commit/1b279e3d4ac33ebd9a3925d1a388c28bd96232d5 Somehow, for some reason, the server-side decoration detection isn't working on KWin's side.
I'll create a bug on the GTK side, and see what they can do about it.
I've created a bug report here: https://bugzilla.gnome.org/show_bug.cgi?id=792889
It turns out that the function for checking whether GTK3 surfaces should use CSD or not was returning "false" for preferring SSD instead of "true". Seems like it was likely never tested after the original patch was submitted, lol.
I've added a patch on the GTK side that should fix that issue. A simple typo can do a lot...
Here is the patch to apply to GTK3 to fix the issue: https://bug792889.bugzilla-attachments.gnome.org/attachment.cgi?id=367417
Thanks for having a look into it.
Turns out it wasn't much of a fix ~ it broke the CSD decorations in Weston. I looked at the code a bit more, and saw that it never bothers to request server-side decorations. The code really seems to have not been tested well, or at all. How fun... :/
At least it was not tested with KWin. It probably was tested with sway which doesn't do any decorations.