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
This commit is contained in:
Owen W. Taylor 2010-11-11 18:42:44 -05:00
parent ca5f2ac3ec
commit d4c28fc5f5
2 changed files with 29 additions and 0 deletions

View File

@ -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 static void
meta_window_tile (MetaWindow *window) meta_window_tile (MetaWindow *window)
{ {

View File

@ -120,6 +120,9 @@ void meta_window_foreach_ancestor (MetaWindow *window,
MetaWindowForeachFunc func, MetaWindowForeachFunc func,
void *user_data); 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_is_mapped (MetaWindow *window);
gboolean meta_window_toplevel_is_mapped (MetaWindow *window); gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
gboolean meta_window_get_icon_geometry (MetaWindow *window, gboolean meta_window_get_icon_geometry (MetaWindow *window,