wayland: Avoid negative size constraints
authorOlivier Fourdan <ofourdan@redhat.com>
Tue, 27 Sep 2016 14:48:57 +0000 (16:48 +0200)
committerSjoerd Simons <sjoerd@debian.org>
Fri, 30 Sep 2016 12:36:52 +0000 (12:36 +0000)
commita01228fdd1ea8798aa4455b9b9f64dd400e17f8f
treedd80686512879cfca8d424a6823690b0c7927de9
parent10b014ca613b096191ae4b9cc7034e58ec2a12d0
wayland: Avoid negative size constraints

Setting the shadow width earlier as done with commit 4cb1b96 to address
bug 771561 proved to cause unexpected side effects on size_allocate
signal propagation.

As the window is sized correctly earlier, the size_allocate signal is
not emitted again in gtk_widget_size_allocate_with_baseline() which
prevents clutter-gtk from relocating its child widget correctly.

To avoid this issue, revert commit 4cb1b96 but make sure the values
passed as min and max size is never negative in Wayland as this is a
protocol error.

With this, the min/max size will be wrong for a short amount of time,
during the state transition, until the shadow width is updated from
gdk_window_set_shadow_width().

This approach is much safer and less intrusive than changing the
size_allocate logic in gtk.

This reverts commit 4cb1b9645e84054c059f174240e8e288c4befe05.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=771915

Gbp-Pq: Name wayland-Avoid-negative-size-constraints.patch
gdk/wayland/gdkwindow-wayland.c
gtk/gtkwindow.c