[mutter] Add meta_window_get_maximized() and meta_window_is_fullscreen()



commit d4c28fc5f544275643e79e46b6e2257e3409d880
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Nov 11 18:42:44 2010 -0500

    Add meta_window_get_maximized() and meta_window_is_fullscreen()
    
    These functions duplicate existing properties; they are added for
    convenience and to avoid the GObject property code on some
    performance critical painting paths.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=592382

 src/core/window.c    |   26 ++++++++++++++++++++++++++
 src/include/window.h |    3 +++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 226f048..6c10454 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3158,6 +3158,32 @@ meta_window_maximize (MetaWindow        *window,
     }
 }
 
+/**
+ * meta_window_get_maximized:
+ *
+ * Gets the current maximization state of the window, as combination
+ * of the %META_MAXIMIZE_HORIZONTAL and %META_MAXIMIZE_VERTICAL flags;
+ *
+ * Return value: current maximization state
+ */
+MetaMaximizeFlags
+meta_window_get_maximized (MetaWindow *window)
+{
+  return ((window->maximized_horizontally ? META_MAXIMIZE_HORIZONTAL : 0) |
+          (window->maximized_vertically ? META_MAXIMIZE_VERTICAL : 0));
+}
+
+/**
+ * meta_window_is_fullscreen:
+ *
+ * Return value: %TRUE if the window is currently fullscreen
+ */
+gboolean
+meta_window_is_fullscreen (MetaWindow *window)
+{
+  return window->fullscreen;
+}
+
 static void
 meta_window_tile (MetaWindow *window)
 {
diff --git a/src/include/window.h b/src/include/window.h
index db32ac4..8819242 100644
--- a/src/include/window.h
+++ b/src/include/window.h
@@ -120,6 +120,9 @@ void     meta_window_foreach_ancestor         (MetaWindow            *window,
                                                MetaWindowForeachFunc  func,
                                                void                  *user_data);
 
+MetaMaximizeFlags meta_window_get_maximized (MetaWindow *window);
+gboolean          meta_window_is_fullscreen (MetaWindow *window);
+
 gboolean meta_window_is_mapped (MetaWindow  *window);
 gboolean meta_window_toplevel_is_mapped (MetaWindow  *window);
 gboolean meta_window_get_icon_geometry (MetaWindow    *window,



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