Commit bed9cb16 authored by Florian Müllner's avatar Florian Müllner
Browse files

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
parent 4ca55278
......@@ -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).
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment