[mutter] Add meta_window_is_on_primary_monitor function
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Add meta_window_is_on_primary_monitor function
- Date: Thu, 17 Mar 2011 12:54:50 +0000 (UTC)
commit eeca838778a77074806d3cb66df4d497c9d4bd43
Author: Alexander Larsson <alexl redhat com>
Date: Wed Mar 9 13:04:18 2011 +0100
Add meta_window_is_on_primary_monitor function
This is useful in a couple of places to avoid opencoding it.
https://bugzilla.gnome.org/show_bug.cgi?id=609258
src/core/window.c | 11 +++++++++++
src/meta/window.h | 1 +
2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 5c845c2..3451f29 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -3213,6 +3213,17 @@ meta_window_is_fullscreen (MetaWindow *window)
return window->fullscreen;
}
+/**
+ * meta_window_is_on_primary_monitor:
+ *
+ * Return value: %TRUE if the window is on the primary monitor
+ */
+gboolean
+meta_window_is_on_primary_monitor (MetaWindow *window)
+{
+ return window->monitor->number == window->screen->primary_monitor_index;
+}
+
void
meta_window_tile (MetaWindow *window)
{
diff --git a/src/meta/window.h b/src/meta/window.h
index 060cc1e..af5602c 100644
--- a/src/meta/window.h
+++ b/src/meta/window.h
@@ -126,6 +126,7 @@ void meta_window_foreach_ancestor (MetaWindow *window,
MetaMaximizeFlags meta_window_get_maximized (MetaWindow *window);
gboolean meta_window_is_fullscreen (MetaWindow *window);
+gboolean meta_window_is_on_primary_monitor (MetaWindow *window);
gboolean meta_window_is_mapped (MetaWindow *window);
gboolean meta_window_toplevel_is_mapped (MetaWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]