From d8bd9f5a66609ab36bfcb7dc114145049adb7af4 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 28 Feb 2011 20:06:58 +0100 Subject: [PATCH] Add and export shell_global_get_primary_monitor_index https://bugzilla.gnome.org/show_bug.cgi?id=609258 --- src/shell-global.c | 17 +++++++++++++++++ src/shell-global.h | 1 + 2 files changed, 18 insertions(+) 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,