Add meta_window_get_transient_for() method

This commit is contained in:
Davyd Madeley 2009-06-10 11:28:21 +08:00
parent dfb0e4f57b
commit 08c5095ad7
2 changed files with 27 additions and 0 deletions

View File

@ -8754,3 +8754,29 @@ meta_window_get_layer (MetaWindow *window)
{
return window->layer;
}
/**
* 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)
{
g_return_val_if_fail (META_IS_WINDOW (window), NULL);
if (window->xtransient_for)
return meta_display_lookup_x_window (window->display,
window->xtransient_for);
else
return NULL;
}

View File

@ -109,5 +109,6 @@ void meta_window_unmaximize (MetaWindow *window,
void meta_window_minimize (MetaWindow *window);
void meta_window_unminimize (MetaWindow *window);
const char *meta_window_get_title (MetaWindow *window);
MetaWindow *meta_window_get_transient_for (MetaWindow *window);
#endif