wayland: Store unconfigured size without margin

We get the unconfigured size request either with or without the shadow
margin already configured, so to get some consistency with the 'saved
size', cut away any potential shadow margin from the size before
storing.

Then when using, add it back, so we always create a configure event with
the correct size.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2576
This commit is contained in:
Jonas Ådahl 2020-04-06 12:07:51 +02:00
parent 2e5f344e3c
commit 814d1e7f06

View File

@ -1149,8 +1149,10 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
if (needs_initial_configure (window) &&
!impl->initial_configure_received)
{
impl->unconfigured_width = width;
impl->unconfigured_height = height;
impl->unconfigured_width = calculate_width_without_margin (window,
width);
impl->unconfigured_height = calculate_height_without_margin (window,
height);
return;
}
@ -1676,9 +1678,16 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
}
else
{
int unconfigured_width;
int unconfigured_height;
unconfigured_width =
calculate_width_with_margin (window, impl->unconfigured_width);
unconfigured_height =
calculate_height_with_margin (window, impl->unconfigured_height);
gdk_wayland_window_configure (window,
impl->unconfigured_width,
impl->unconfigured_height,
unconfigured_width,
unconfigured_height,
impl->scale);
}