Commit d92df4ff authored by Benjamin Otte's avatar Benjamin Otte

Merge branch 'gtk-3-22' into 'gtk-3-22'

wayland: Fix setting geometry hints

See merge request GNOME/gtk!98
parents 22fd5b57 8e74e515
...@@ -3628,7 +3628,7 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window, ...@@ -3628,7 +3628,7 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
{ {
GdkWaylandDisplay *display_wayland; GdkWaylandDisplay *display_wayland;
GdkWindowImplWayland *impl; GdkWindowImplWayland *impl;
int width, height; int min_width = 0, min_height = 0, max_width = 0, max_height = 0;
if (GDK_WINDOW_DESTROYED (window) || if (GDK_WINDOW_DESTROYED (window) ||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
...@@ -3645,39 +3645,29 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window, ...@@ -3645,39 +3645,29 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
if (geom_mask & GDK_HINT_MIN_SIZE) if (geom_mask & GDK_HINT_MIN_SIZE)
{ {
width = MAX (0, geometry->min_width - (impl->margin_left + impl->margin_right)); min_width = MAX (0, geometry->min_width - (impl->margin_left + impl->margin_right));
height = MAX (0, geometry->min_height - (impl->margin_top + impl->margin_bottom)); min_height = MAX (0, geometry->min_height - (impl->margin_top + impl->margin_bottom));
}
else
{
width = 0;
height = 0;
} }
if (geom_mask & GDK_HINT_MAX_SIZE) if (geom_mask & GDK_HINT_MAX_SIZE)
{ {
width = MAX (0, geometry->max_width - (impl->margin_left + impl->margin_right)); max_width = MAX (0, geometry->max_width - (impl->margin_left + impl->margin_right));
height = MAX (0, geometry->max_height - (impl->margin_top + impl->margin_bottom)); max_height = MAX (0, geometry->max_height - (impl->margin_top + impl->margin_bottom));
}
else
{
width = 0;
height = 0;
} }
switch (display_wayland->shell_variant) switch (display_wayland->shell_variant)
{ {
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL: case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
xdg_toplevel_set_min_size (impl->display_server.xdg_toplevel, xdg_toplevel_set_min_size (impl->display_server.xdg_toplevel,
width, height); min_width, min_height);
xdg_toplevel_set_max_size (impl->display_server.xdg_toplevel, xdg_toplevel_set_max_size (impl->display_server.xdg_toplevel,
width, height); max_width, max_height);
break; break;
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6: case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
zxdg_toplevel_v6_set_min_size (impl->display_server.zxdg_toplevel_v6, zxdg_toplevel_v6_set_min_size (impl->display_server.zxdg_toplevel_v6,
width, height); min_width, min_height);
zxdg_toplevel_v6_set_max_size (impl->display_server.zxdg_toplevel_v6, zxdg_toplevel_v6_set_max_size (impl->display_server.zxdg_toplevel_v6,
width, height); max_width, max_height);
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment