[mutter] Add API to get the monitor of a window
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Add API to get the monitor of a window
- Date: Thu, 17 Mar 2011 12:54:45 +0000 (UTC)
commit d6f0d2c64ce7342e770a071a3ca8b24df2c140e7
Author: Alexander Larsson <alexl redhat com>
Date: Mon Feb 28 15:21:35 2011 +0100
Add API to get the monitor of a window
https://bugzilla.gnome.org/show_bug.cgi?id=609258
src/core/window.c | 14 ++++++++++++++
src/meta/window.h | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 1bf4799..5c845c2 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 467434f..060cc1e 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]