mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
window: Keep track of the last full-maximization state
In order to be able to toggle between tiled and normal/maximized states, we need to keep track of the last full maximization state. https://bugzilla.gnome.org/show_bug.cgi?id=648700
This commit is contained in:
parent
4ca552785f
commit
bed9cb1648
@ -129,6 +129,9 @@ struct _MetaWindow
|
||||
* this is the current mode. If not, it is the mode which will be
|
||||
* requested after the window grab is released */
|
||||
guint tile_mode : 2;
|
||||
/* The last "full" maximized/unmaximized state. We need to keep track of
|
||||
* that to toggle between normal/tiled or maximized/tiled states. */
|
||||
guint saved_maximize : 1;
|
||||
int tile_monitor_number;
|
||||
|
||||
/* Whether we're shaded */
|
||||
|
@ -3419,6 +3419,9 @@ meta_window_maximize_internal (MetaWindow *window,
|
||||
else
|
||||
meta_window_save_rect (window);
|
||||
|
||||
if (maximize_horizontally && maximize_vertically)
|
||||
window->saved_maximize = TRUE;
|
||||
|
||||
window->maximized_horizontally =
|
||||
window->maximized_horizontally || maximize_horizontally;
|
||||
window->maximized_vertically =
|
||||
@ -3685,6 +3688,9 @@ meta_window_unmaximize_internal (MetaWindow *window,
|
||||
unmaximize_vertically = directions & META_MAXIMIZE_VERTICAL;
|
||||
g_assert (unmaximize_horizontally || unmaximize_vertically);
|
||||
|
||||
if (unmaximize_horizontally && unmaximize_vertically)
|
||||
window->saved_maximize = FALSE;
|
||||
|
||||
/* Only do something if the window isn't already maximized in the
|
||||
* given direction(s).
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user