From bf7ae3e4d3ffa4b9ac3ca8668aabb3efc75faa6f Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 11 Nov 2010 18:42:44 -0500 Subject: [PATCH] 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(+) diff --git a/src/core/window.c b/src/core/window.c index 226f048f9..6c1045456 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 db32ac4d6..8819242f5 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,