summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDavyd Madeley <[email protected]>2014-09-27 17:40:10 +0300
committerVictor Kareh <[email protected]>2018-08-28 09:38:37 -0400
commit4f47c5be61320102120fcae6c8c04f63c5b4f5b5 (patch)
tree53ef4904554b85522b4466ba410e22f3aca68014 /src/core
parenta47f178df47ae26bf080b5c4f34762102c58085e (diff)
downloadmarco-4f47c5be61320102120fcae6c8c04f63c5b4f5b5.tar.bz2
marco-4f47c5be61320102120fcae6c8c04f63c5b4f5b5.tar.xz
Add meta_window_get_transient_for() method
NOTE: Patch copied from mutter and adapted for metacity.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/window.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/core/window.c b/src/core/window.c
index 44084a07..8cffdde8 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -8630,6 +8630,29 @@ meta_window_get_xwindow (MetaWindow *window)
return window->xwindow;
}
+/**
+ * meta_window_get_transient_for:
+ * @window: a #MetaWindow
+ *
+ * Returns the #MetaWindow for the window that is pointed to by the
+ * WM_TRANSIENT_FOR hint on this window (see XGetTransientForHint()
+ * or XSetTransientForHint()). Metacity keeps transient windows above their
+ * parents. A typical usage of this hint is for a dialog that wants to stay
+ * above its associated window.
+ *
+ * Return value: (transfer none): the window this window is transient for, or
+ * %NULL if the WM_TRANSIENT_FOR hint is unset or does not point to a toplevel
+ * window that Metacity knows about.
+ */
+MetaWindow *
+meta_window_get_transient_for (MetaWindow *window)
+{
+ if (window->xtransient_for)
+ return meta_display_lookup_x_window (window->display, window->xtransient_for);
+ else
+ return NULL;
+}
+
gboolean
meta_window_is_maximized (MetaWindow *window)
{