wayland: Add margin to saved size when restoring size

We're normally going from a fixed size to a floating state when we're
using the saved size, meaning we're practically always going towards a
state where the shadow margin will non-empty. However, if we don't
include any margin when creating a new configure request, we'll end up
resizing to a slightly smaller size as gtk will cut off the margin from
the configure request when changing the window widget size.

This wasn't visible when e.g. going from maximized to floating, as we'd
add the shadow margin at a later point, which would effectively "grow"
the widnow size, but when we're going from tiled to floating, we both
start and end with a non-empty shadow margin, meaning we'd shrink ever
so slightly every time going between tiled and floating.
This commit is contained in:
Jonas Ådahl 2020-04-02 17:53:57 +02:00
parent 50aa947e51
commit 3b91c20eac

View File

@ -1580,6 +1580,8 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
if (width > 0 && height > 0)
{
GdkWindowHints geometry_mask = impl->geometry_mask;
int configure_width;
int configure_height;
/* Ignore size increments for maximized/fullscreen windows */
if (fixed_size)
@ -1598,7 +1600,20 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
_gdk_wayland_window_save_size (window);
}
gdk_wayland_window_configure (window, width, height, impl->scale);
if (saved_size)
{
configure_width = width + impl->margin_left + impl->margin_right;
configure_height = height + impl->margin_top + impl->margin_bottom;
}
else
{
configure_width = width;
configure_height = height;
}
gdk_wayland_window_configure (window,
configure_width,
configure_height,
impl->scale);
}
else
{