[gtk/gtk-3-24: 4/5] wayland: Add margin to saved size when restoring size
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 4/5] wayland: Add margin to saved size when restoring size
- Date: Thu, 2 Apr 2020 17:26:18 +0000 (UTC)
commit 3b91c20eac6c1480af9f7ea3067e24132591fd6c
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Apr 2 17:53:57 2020 +0200
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.
gdk/wayland/gdkwindow-wayland.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 9c9d311abf..0ba53e75e2 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -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
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]