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

@ -429,6 +429,7 @@ meta_display_open (void)
GSList *tmp;
int i;
guint32 timestamp;
char buf[257];
/* A list of all atom names, so that we can intern them in one go. */
char *atom_names[] = {
@ -463,6 +464,11 @@ meta_display_open (void)
*/
the_display->name = g_strdup (XDisplayName (NULL));
the_display->xdisplay = xdisplay;
if (gethostname (buf, sizeof(buf)-1) == 0)
{
buf[sizeof(buf)-1] = '\0';
the_display->hostname = g_strdup (buf);
}
the_display->error_trap_synced_at_last_pop = TRUE;
the_display->error_traps = 0;
the_display->error_trap_handler = NULL;