wayland/window: Provide prior floating window dimensions

Implements the "prior window window geometry dimensions" as described in
the documentation of 'xdg_toplevel' request 'unset_maximized':
"If available and applicable, the compositor will include the window
geometry dimensions the window had prior to being maximized in the
configure event."
and 'unset_fullscreen':
"The compositor may include the previous window geometry dimensions in
the configure event, if applicable."

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/792.
This commit is contained in:
Christian Rauch 2019-09-18 23:59:50 +01:00 committed by Jonas Ådahl
parent f4a1dcfc93
commit a93ef84d57

View File

@ -256,24 +256,8 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
* to the Wayland surface. */
geometry_scale = meta_window_wayland_get_geometry_scale (window);
if (flags & META_MOVE_RESIZE_UNMAXIMIZE &&
!meta_window_is_fullscreen (window))
{
configured_width = 0;
configured_height = 0;
}
else if (flags & META_MOVE_RESIZE_UNFULLSCREEN &&
!meta_window_get_maximized (window) &&
meta_window_get_tile_mode (window) == META_TILE_NONE)
{
configured_width = 0;
configured_height = 0;
}
else
{
configured_width = constrained_rect.width / geometry_scale;
configured_height = constrained_rect.height / geometry_scale;
}
configured_width = constrained_rect.width / geometry_scale;
configured_height = constrained_rect.height / geometry_scale;
/* For wayland clients, the size is completely determined by the client,
* and while this allows to avoid some trickery with frames and the resulting