From 59bf1f48380feb46e42863d4b4fa121261f09146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 13 Jun 2019 10:35:35 +0200 Subject: [PATCH] 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 --- src/core/window-private.h | 7 ++++--- src/core/window.c | 3 ++- src/wayland/meta-window-wayland.c | 7 +++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/core/window-private.h b/src/core/window-private.h index 6a27949c8..0c71152a4 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -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 diff --git a/src/core/window.c b/src/core/window.c index c1179c6ad..1b36ff7b9 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -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); diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index db6476f19..d72b3bbc1 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -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;