After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 620585 - Add meta_window_is_remote
Add meta_window_is_remote
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-04 17:57 UTC by Colin Walters
Modified: 2010-06-07 13:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add meta_window_is_remote (4.70 KB, patch)
2010-06-04 17:57 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2010-06-04 17:57:29 UTC
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.
Comment 1 Colin Walters 2010-06-04 17:57:31 UTC
Created attachment 162765 [details] [review]
Add meta_window_is_remote
Comment 2 Tomas Frydrych 2010-06-07 05:34:48 UTC
Comment on attachment 162765 [details] [review]
Add meta_window_is_remote

+gboolean
+meta_window_is_remote (MetaWindow *window)
+{
+  g_return_val_if_fail (META_IS_WINDOW (window), FALSE);
+
+  return strcmp (window->wm_client_machine, window->display->hostname) != 0;

The strcmp needs a NULL check on both parameters, maybe use g_strcmp0 instead ?

Otherwise looks fine.
Comment 3 Colin Walters 2010-06-07 13:51:03 UTC
Attachment 162765 [details] pushed as 3a73f6b - Add meta_window_is_remote