--- Comment #10 from Olivier Fourdan <ofour...@redhat.com> ---
Created attachment 335846
(In reply to Sjoerd Simons from comment #9)
> CSD != shadows.
Not sure what you mean by that sentence...
With CSD, the shadows are drawn by the client, i.e. they are within the
toplevel GdkWindow size whereas with SSD the shadows are drawn by the window
manager, ie outside of the GdkWindow.
That's precisely why you need _GTK_FRAME_EXTENTS for CSD on X11.
> If your claim is correct (which i don't think it is, but i could be wrong)
> other code in gdkwindow-wayland is obviously wrong as
> gdk_wayland_window_get_window_geometry already removed the margins for the
> geometry, so calling _set_geometry_hints with that geometry will decrease
> with the margins twice..
> clamping make sense to prevent protocol errors, but from what i can tell the
> problem here isn't the application given dumb values...
To demonstrate why we need to remove the shadow sizes, please consider the
attached sample program.
What this code does is trivially setting the min height of its window to 1
pixel usign the GtkWindow API (gtk_window_set_geometry_hints()).
Now, this needs to work in all 3 following cases:
1. X11 without CSD (i.e. with SSD)
2. X11 with CSD
Which means that the geometry value passed to X11 must match what the program
sets as-is, whereas the values given to CSD must add up the header bar and the
This program works as expected in all 3 cases, ie the window *content* (ie not
counting the shadows and hederbar) minimum is 1 in X11 with SSD, X11 with CSD
and Wayland with CSD.
Applying your patch results in the min height being too large in Wayland as
seen in WAYLAND_DEBUG=1 logs:
Without your patch:
[3747632.054] -> firstname.lastname@example.org_min_size(248, 37)
[3747632.062] -> email@example.com_max_size(248, 248)
[3747632.070] -> firstname.lastname@example.org_window_geometry(26, 23, 248, 239)
With your patch:
[3782500.453] -> email@example.com_min_size(300, 89)
[3782500.462] -> firstname.lastname@example.org_max_size(300, 300)
[3782500.472] -> email@example.com_window_geometry(26, 23, 248, 248)
And resizing to the min gives:
[4270822.924] firstname.lastname@example.org(248, 37, array)
And 37 is the height of the gtkheaderbar, matching the min height (without your
patch) whereas your patch gives a min height of 89.
You are receiving this mail because:
You are on the CC list for the bug.
wayland-bugs mailing list