Add meta_window_is_remote

It's useful for plugins to be able to easily detect whether
or not a window is from a remote host.  Also, make use of this
in the window delete codepath, instead of looking up the hostname
each time.

https://bugzilla.gnome.org/show_bug.cgi?id=620585
This commit is contained in:
Colin Walters
2010-06-04 13:57:41 -04:00
parent 343474a570
commit 3a73f6b8ec
5 changed files with 33 additions and 23 deletions

View File

@@ -9115,6 +9115,21 @@ meta_window_get_client_machine (MetaWindow *window)
return window->wm_client_machine;
}
/**
* meta_window_is_remote:
* @window: a #MetaWindow
*
* Returns: %TRUE if this window originates from a host
* different from the one running mutter.
*/
gboolean
meta_window_is_remote (MetaWindow *window)
{
g_return_val_if_fail (META_IS_WINDOW (window), FALSE);
return g_strcmp0 (window->wm_client_machine, window->display->hostname) != 0;
}
/**
* meta_window_is_modal:
* @window: a #MetaWindow