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:
@@ -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
|
||||
|
Reference in New Issue
Block a user