summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-05 20:22:02 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-10-05 20:24:19 -0400
commit20fb7812df5134b84a0e4805f7d0aebe0bfeb1be (patch)
treead4ee7bc2c303de0126ee87b253dad0e04a4b3e8 /gtk/gtkwindow.c
parent082edd957e0fc4cd5dd6109664ba4c0b65f643c7 (diff)
downloadgtk+-20fb7812df5134b84a0e4805f7d0aebe0bfeb1be.tar.gz
window: Fix window size snapping back
We were not updating the remembered size at all when the window is interactively resized, causing it to snap back to its default size the next time we call gdk_toplevel_present(). This is a bandaid fix to prevent very broken resizing behavior, until we have properly redone toplevel sizing. Fixes: #3076
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 947b178f76..7377502371 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4729,6 +4729,22 @@ surface_size_changed (GtkWidget *widget,
check_scale_changed (GTK_WINDOW (widget));
+ if (!(priv->state & (GDK_TOPLEVEL_STATE_FULLSCREEN |
+ GDK_TOPLEVEL_STATE_MAXIMIZED |
+ GDK_TOPLEVEL_STATE_TILED |
+ GDK_TOPLEVEL_STATE_TOP_TILED |
+ GDK_TOPLEVEL_STATE_RIGHT_TILED |
+ GDK_TOPLEVEL_STATE_BOTTOM_TILED |
+ GDK_TOPLEVEL_STATE_LEFT_TILED |
+ GDK_TOPLEVEL_STATE_MINIMIZED)))
+ {
+ GtkWindowGeometryInfo *info;
+
+ info = gtk_window_get_geometry_info (GTK_WINDOW (widget), TRUE);
+ info->last.configure_request.width = width;
+ info->last.configure_request.height = height;
+ }
+
/* priv->configure_request_count incremented for each
* configure request, and decremented to a min of 0 for
* each configure notify.
@@ -5490,7 +5506,6 @@ gtk_window_move_resize (GtkWindow *window)
info->last.geometry = new_geometry;
info->last.flags = new_flags;
info->last.configure_request = new_request;
-
/* need to set PPosition so the WM will look at our position,
* but we don't want to count PPosition coming and going as a hints
* change for future iterations. So we saved info->last prior to