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
This commit is contained in:
Olivier Fourdan 2016-09-19 16:11:54 +02:00
parent b6ac1b4bbf
commit 4cb1b9645e

View File

@ -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);
}