From 4cb1b9645e84054c059f174240e8e288c4befe05 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 19 Sep 2016 16:11:54 +0200 Subject: [PATCH] gtkwindow: Update shadow size on state change Otherwise, with CSD, we could have a discrepancy where gtk uses the right values for the shadows whereas the gdk backend still uses the old values, leading in some cases to invalid or negative min size being computed (which, in Wayland, leads a protocol error). https://bugzilla.gnome.org/show_bug.cgi?id=771561 --- gtk/gtkwindow.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index fc1e050f77..9808475f73 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7528,6 +7528,19 @@ update_window_style_classes (GtkWindow *window) gtk_style_context_remove_class (context, "fullscreen"); } +static void +update_window_borders (GtkWindow *window) +{ + GtkWindowPrivate *priv = window->priv; + GtkBorder window_border = { 0 }; + + if (priv->client_decorated && priv->use_client_shadow) + { + get_shadow_width (window, &window_border); + update_shadow_width (window, &window_border); + } +} + static void popover_size_allocate (GtkWidget *widget, GtkWindowPopover *popover, @@ -7798,6 +7811,7 @@ gtk_window_state_event (GtkWidget *widget, { update_window_style_classes (window); update_window_buttons (window); + update_window_borders (window); gtk_widget_queue_resize (widget); }