diff options
author | Christian Rauch <Rauch.Christian@gmx.de> | 2020-03-31 22:30:38 +0100 |
---|---|---|
committer | Jonas Ã…dahl <jadahl@gmail.com> | 2020-10-22 16:29:09 +0000 |
commit | a51ad8f932cb55bdd8a62fc5d8d10af7fc62b0a0 (patch) | |
tree | 746fdc4425b8318b5221035a2c15ccdba415ef84 | |
parent | 3faea8532c0935ee07ff2fff0517f230aa5d6c0c (diff) | |
download | mutter-a51ad8f932cb55bdd8a62fc5d8d10af7fc62b0a0.tar.gz |
core/window: Store/load window dimensions before/after fullscreen
We will use a dedicated variable when transitioning to/from fullscreen state
and leave the previously used 'saved_rect' exclusively for transitioning
between floating and maximized state.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/801
-rw-r--r-- | src/core/window-private.h | 3 | ||||
-rw-r--r-- | src/core/window.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/core/window-private.h b/src/core/window-private.h index 2ef0db714..39fd38d12 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -497,6 +497,9 @@ struct _MetaWindow /* The geometry to restore when we unmaximize. */ MetaRectangle saved_rect; + /* The geometry to restore when we unfullscreen. */ + MetaRectangle saved_rect_fullscreen; + /* This is the geometry the window will have if no constraints have * applied. We use this whenever we are moving implicitly (for example, * if we move to avoid a panel, we can snap back to this position if diff --git a/src/core/window.c b/src/core/window.c index 68aca3462..944d0d8fe 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3471,7 +3471,7 @@ meta_window_make_fullscreen_internal (MetaWindow *window) meta_window_unshade (window, timestamp); } - meta_window_save_rect (window); + window->saved_rect_fullscreen = window->rect; window->fullscreen = TRUE; @@ -3530,7 +3530,7 @@ meta_window_unmake_fullscreen (MetaWindow *window) "Unfullscreening %s", window->desc); window->fullscreen = FALSE; - target_rect = window->saved_rect; + target_rect = window->saved_rect_fullscreen; meta_window_frame_size_changed (window); meta_window_get_frame_rect (window, &old_frame_rect); @@ -4074,7 +4074,7 @@ meta_window_move_resize_internal (MetaWindow *window, temporary_rect = window->rect; if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION) && !(flags & META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE) && - (unconstrained_rect.width > 0 && unconstrained_rect.height > 0) && + !(flags & (META_MOVE_RESIZE_UNMAXIMIZE | META_MOVE_RESIZE_UNFULLSCREEN)) && window->monitor) { MetaRectangle old_rect; |