[mutter] [MetaWindow] Expose maximized state as properties



commit d21da5643b60e6a40c32478ce834f94747ca21de
Author: Florian Müllner <fmuellner src gnome org>
Date:   Fri Feb 12 21:26:52 2010 +0100

    [MetaWindow] Expose maximized state as properties
    
    Add properties for the EWMH _NET_WM_STATE_MAXIMIZED_HORZ and
    _NET_WM_STATE_MAXIMIZED_VERT hints.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=590706

 src/core/window.c |   38 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 36 insertions(+), 2 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 4e74595..71a4f60 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -141,6 +141,8 @@ enum {
   PROP_MINI_ICON,
   PROP_DECORATED,
   PROP_FULLSCREEN,
+  PROP_MAXIMIZED_HORIZONTALLY,
+  PROP_MAXIMIZED_VERTICALLY,
   PROP_WINDOW_TYPE,
   PROP_USER_TIME,
   PROP_DEMANDS_ATTENTION,
@@ -208,6 +210,12 @@ meta_window_get_property(GObject         *object,
     case PROP_FULLSCREEN:
       g_value_set_boolean (value, win->fullscreen);
       break;
+    case PROP_MAXIMIZED_HORIZONTALLY:
+      g_value_set_boolean (value, win->maximized_horizontally);
+      break;
+    case PROP_MAXIMIZED_VERTICALLY:
+      g_value_set_boolean (value, win->maximized_vertically);
+      break;
     case PROP_WINDOW_TYPE:
       g_value_set_enum (value, win->type);
       break;
@@ -277,7 +285,7 @@ meta_window_class_init (MetaWindowClass *klass)
                                    PROP_DECORATED,
                                    g_param_spec_boolean ("decorated",
                                                          "Decorated",
-                                                         "Whether windos is decorated",
+                                                         "Whether window is decorated",
                                                          TRUE,
                                                          G_PARAM_READABLE));
 
@@ -285,7 +293,23 @@ meta_window_class_init (MetaWindowClass *klass)
                                    PROP_FULLSCREEN,
                                    g_param_spec_boolean ("fullscreen",
                                                          "Fullscreen",
-                                                         "Whether windos is fullscreened",
+                                                         "Whether window is fullscreened",
+                                                         FALSE,
+                                                         G_PARAM_READABLE));
+
+  g_object_class_install_property (object_class,
+                                   PROP_MAXIMIZED_HORIZONTALLY,
+                                   g_param_spec_boolean ("maximized-horizontally",
+                                                         "Maximized horizontally",
+                                                         "Whether window is maximized horizontally",
+                                                         FALSE,
+                                                         G_PARAM_READABLE));
+
+  g_object_class_install_property (object_class,
+                                   PROP_MAXIMIZED_VERTICALLY,
+                                   g_param_spec_boolean ("maximized-vertically",
+                                                         "Maximizing vertically",
+                                                         "Whether window is maximized vertically",
                                                          FALSE,
                                                          G_PARAM_READABLE));
 
@@ -3027,6 +3051,11 @@ meta_window_maximize_internal (MetaWindow        *window,
 
   recalc_window_features (window);
   set_net_wm_state (window);
+
+  g_object_freeze_notify (G_OBJECT (window));
+  g_object_notify (G_OBJECT (window), "maximized-horizontally");
+  g_object_notify (G_OBJECT (window), "maximized-vertically");
+  g_object_thaw_notify (G_OBJECT (window));
 }
 
 void
@@ -3231,6 +3260,11 @@ meta_window_unmaximize (MetaWindow        *window,
       recalc_window_features (window);
       set_net_wm_state (window);
     }
+
+    g_object_freeze_notify (G_OBJECT (window));
+    g_object_notify (G_OBJECT (window), "maximized-horizontally");
+    g_object_notify (G_OBJECT (window), "maximized-vertically");
+    g_object_thaw_notify (G_OBJECT (window));
 }
 
 void



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