diff --git a/src/shell-global.c b/src/shell-global.c index 2d55033fa..32836cba5 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -1410,6 +1410,23 @@ shell_global_get_primary_monitor (ShellGlobal *global) return meta_rectangle_copy (&rect); } +/** + * shell_global_get_primary_monitor_index: + * @global: the #ShellGlobal + * + * Gets the index of the primary monitor (the one that the + * panel is on). + * + * Return value: the index of the primary monitor + */ +int +shell_global_get_primary_monitor_index (ShellGlobal *global) +{ + MetaScreen *screen = shell_global_get_screen (global); + + return meta_screen_get_primary_monitor (screen); +} + /** * shell_global_get_focus_monitor: * @global: the #ShellGlobal diff --git a/src/shell-global.h b/src/shell-global.h index f05391915..40f9a8f9b 100644 --- a/src/shell-global.h +++ b/src/shell-global.h @@ -100,6 +100,7 @@ void shell_global_format_time_relative_pretty (ShellGlobal *global, guint delta, GSList *shell_global_get_monitors (ShellGlobal *global); MetaRectangle *shell_global_get_primary_monitor (ShellGlobal *global); +int shell_global_get_primary_monitor_index (ShellGlobal *global); MetaRectangle *shell_global_get_focus_monitor (ShellGlobal *global); void shell_global_get_pointer (ShellGlobal *global,