diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2016-09-27 16:48:57 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2016-09-28 09:28:52 +0200 |
commit | dbd0923b5f7b4a7cdea182c8d20085c013c4571c (patch) | |
tree | 86d11c253667251a94d39efb726acf3be9471da2 /gdk/wayland | |
parent | b684b23c74202cd78dcc1885effcb30c97bea9d8 (diff) | |
download | gtk+-dbd0923b5f7b4a7cdea182c8d20085c013c4571c.tar.gz |
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
Diffstat (limited to 'gdk/wayland')
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index fa8dbe0e87..f35c4c8c2b 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -2992,8 +2992,8 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window, if (geom_mask & GDK_HINT_MIN_SIZE) { - width = geometry->min_width - (impl->margin_left + impl->margin_right); - height = geometry->min_height - (impl->margin_top + impl->margin_bottom); + width = MAX (0, geometry->min_width - (impl->margin_left + impl->margin_right)); + height = MAX (0, geometry->min_height - (impl->margin_top + impl->margin_bottom)); } else { @@ -3005,8 +3005,8 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window, if (geom_mask & GDK_HINT_MAX_SIZE) { - width = geometry->max_width - (impl->margin_left + impl->margin_right); - height = geometry->max_height - (impl->margin_top + impl->margin_bottom); + width = MAX (0, geometry->max_width - (impl->margin_left + impl->margin_right)); + height = MAX (0, geometry->max_height - (impl->margin_top + impl->margin_bottom)); } else { |