[mutter] core/window: Store/load window dimensions before/after fullscreen



commit a51ad8f932cb55bdd8a62fc5d8d10af7fc62b0a0
Author: Christian Rauch <Rauch Christian gmx de>
Date:   Tue Mar 31 22:30:38 2020 +0100

    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

 src/core/window-private.h | 3 +++
 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 2ef0db7140..39fd38d125 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 68aca34626..944d0d8fe7 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]