Add meta_window_is_on_primary_monitor function

This is useful in a couple of places to avoid opencoding it.

https://bugzilla.gnome.org/show_bug.cgi?id=609258
This commit is contained in:
Alexander Larsson 2011-03-09 13:04:18 +01:00
parent d6f0d2c64c
commit eeca838778
2 changed files with 12 additions and 0 deletions

View File

@ -3213,6 +3213,17 @@ meta_window_is_fullscreen (MetaWindow *window)
return window->fullscreen; return window->fullscreen;
} }
/**
* meta_window_is_on_primary_monitor:
*
* Return value: %TRUE if the window is on the primary monitor
*/
gboolean
meta_window_is_on_primary_monitor (MetaWindow *window)
{
return window->monitor->number == window->screen->primary_monitor_index;
}
void void
meta_window_tile (MetaWindow *window) meta_window_tile (MetaWindow *window)
{ {

View File

@ -126,6 +126,7 @@ void meta_window_foreach_ancestor (MetaWindow *window,
MetaMaximizeFlags meta_window_get_maximized (MetaWindow *window); MetaMaximizeFlags meta_window_get_maximized (MetaWindow *window);
gboolean meta_window_is_fullscreen (MetaWindow *window); gboolean meta_window_is_fullscreen (MetaWindow *window);
gboolean meta_window_is_on_primary_monitor (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);