[gnome-shell] Add and export shell_global_get_primary_monitor_index
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Add and export shell_global_get_primary_monitor_index
- Date: Wed, 16 Mar 2011 19:34:13 +0000 (UTC)
commit d8bd9f5a66609ab36bfcb7dc114145049adb7af4
Author: Alexander Larsson <alexl redhat com>
Date: Mon Feb 28 20:06:58 2011 +0100
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(+), 0 deletions(-)
---
diff --git a/src/shell-global.c b/src/shell-global.c
index 2d55033..32836cb 100644
--- a/src/shell-global.c
+++ b/src/shell-global.c
@@ -1411,6 +1411,23 @@ shell_global_get_primary_monitor (ShellGlobal *global)
}
/**
+ * 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 f053919..40f9a8f 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]