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
This commit is contained in:
parent
3faea8532c
commit
a51ad8f932
@ -497,6 +497,9 @@ struct _MetaWindow
|
|||||||
/* The geometry to restore when we unmaximize. */
|
/* The geometry to restore when we unmaximize. */
|
||||||
MetaRectangle saved_rect;
|
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
|
/* This is the geometry the window will have if no constraints have
|
||||||
* applied. We use this whenever we are moving implicitly (for example,
|
* 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
|
* if we move to avoid a panel, we can snap back to this position if
|
||||||
|
@ -3471,7 +3471,7 @@ meta_window_make_fullscreen_internal (MetaWindow *window)
|
|||||||
meta_window_unshade (window, timestamp);
|
meta_window_unshade (window, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_window_save_rect (window);
|
window->saved_rect_fullscreen = window->rect;
|
||||||
|
|
||||||
window->fullscreen = TRUE;
|
window->fullscreen = TRUE;
|
||||||
|
|
||||||
@ -3530,7 +3530,7 @@ meta_window_unmake_fullscreen (MetaWindow *window)
|
|||||||
"Unfullscreening %s", window->desc);
|
"Unfullscreening %s", window->desc);
|
||||||
|
|
||||||
window->fullscreen = FALSE;
|
window->fullscreen = FALSE;
|
||||||
target_rect = window->saved_rect;
|
target_rect = window->saved_rect_fullscreen;
|
||||||
|
|
||||||
meta_window_frame_size_changed (window);
|
meta_window_frame_size_changed (window);
|
||||||
meta_window_get_frame_rect (window, &old_frame_rect);
|
meta_window_get_frame_rect (window, &old_frame_rect);
|
||||||
@ -4074,7 +4074,7 @@ meta_window_move_resize_internal (MetaWindow *window,
|
|||||||
temporary_rect = window->rect;
|
temporary_rect = window->rect;
|
||||||
if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION) &&
|
if (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION) &&
|
||||||
!(flags & META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE) &&
|
!(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)
|
window->monitor)
|
||||||
{
|
{
|
||||||
MetaRectangle old_rect;
|
MetaRectangle old_rect;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user