[mutter] window: Keep track of the last full-maximization state
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] window: Keep track of the last full-maximization state
- Date: Tue, 13 Dec 2011 13:41:50 +0000 (UTC)
commit bed9cb164834179527a28f4a129a4bc83b05f041
Author: Florian MÃllner <fmuellner gnome org>
Date: Mon Dec 5 21:52:46 2011 +0100
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
src/core/window-private.h | 3 +++
src/core/window.c | 6 ++++++
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 55afdde..b05087b 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -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 */
diff --git a/src/core/window.c b/src/core/window.c
index 40365d9..488a80a 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -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).
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]