diff --git a/src/core/window.c b/src/core/window.c index 1bf47997f..5c845c29e 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3995,6 +3995,20 @@ move_attached_dialog (MetaWindow *window, return FALSE; } +/** + * meta_window_get_monitor: + * @window: a #MetaWindow + * + * Gets index of the monitor that this window is on. + * + * Return Value: The index of the monitor in the screens monitor list + */ +int +meta_window_get_monitor (MetaWindow *window) +{ + return window->monitor->number; +} + void meta_window_update_monitor (MetaWindow *window) { diff --git a/src/meta/window.h b/src/meta/window.h index 467434f55..060cc1e96 100644 --- a/src/meta/window.h +++ b/src/meta/window.h @@ -81,6 +81,7 @@ Window meta_window_get_xwindow (MetaWindow *window); MetaWindowType meta_window_get_window_type (MetaWindow *window); Atom meta_window_get_window_type_atom (MetaWindow *window); MetaWorkspace *meta_window_get_workspace (MetaWindow *window); +int meta_window_get_monitor (MetaWindow *window); gboolean meta_window_is_on_all_workspaces (MetaWindow *window); gboolean meta_window_is_hidden (MetaWindow *window); void meta_window_activate (MetaWindow *window,guint32 current_time);