1
0
Fork 0

window/wayland: Don't always use constrained size when unfullscreening

When we're unfullscreening, we might be returning to a window state that
has its size either managed by constraints (tiled, maximized), or not
(floating). Lets just pass the configure size 0x0 when we're not using
constrained sizes (i.e. the window going from being fullscreen to not
maximized) and let the application decide how to size itself.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/638

https://gitlab.gnome.org/GNOME/mutter/merge_requests/621
This commit is contained in:
Jonas Ådahl 2019-06-13 10:35:35 +02:00 committed by Georges Basile Stavracas Neto
parent db0f85ba5d
commit 59bf1f4838
3 changed files with 13 additions and 4 deletions

View file

@ -81,9 +81,10 @@ typedef enum
META_MOVE_RESIZE_WAYLAND_RESIZE = 1 << 4,
META_MOVE_RESIZE_STATE_CHANGED = 1 << 5,
META_MOVE_RESIZE_UNMAXIMIZE = 1 << 6,
META_MOVE_RESIZE_FORCE_MOVE = 1 << 7,
META_MOVE_RESIZE_WAYLAND_STATE_CHANGED = 1 << 8,
META_MOVE_RESIZE_FORCE_UPDATE_MONITOR = 1 << 9,
META_MOVE_RESIZE_UNFULLSCREEN = 1 << 7,
META_MOVE_RESIZE_FORCE_MOVE = 1 << 8,
META_MOVE_RESIZE_WAYLAND_STATE_CHANGED = 1 << 9,
META_MOVE_RESIZE_FORCE_UPDATE_MONITOR = 1 << 10,
} MetaMoveResizeFlags;
typedef enum

View file

@ -3561,7 +3561,8 @@ meta_window_unmake_fullscreen (MetaWindow *window)
meta_window_move_resize_internal (window,
(META_MOVE_RESIZE_MOVE_ACTION |
META_MOVE_RESIZE_RESIZE_ACTION |
META_MOVE_RESIZE_STATE_CHANGED),
META_MOVE_RESIZE_STATE_CHANGED |
META_MOVE_RESIZE_UNFULLSCREEN),
NorthWestGravity,
target_rect);

View file

@ -224,6 +224,13 @@ meta_window_wayland_move_resize_internal (MetaWindow *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;