diff --git a/src/client.c b/src/client.c index 4e86808..239b0ab 100644 --- a/src/client.c +++ b/src/client.c @@ -105,6 +105,8 @@ struct _ButtonPressData }; /* Forward decl */ +static gchar* +clientCreateNameWithHost(DisplayInfo *display_info, gchar *name, gchar *hostname); static void clientUpdateIconPix (Client *c); static gboolean @@ -170,7 +172,6 @@ clientCreateTitleName (Client *c, gchar *name, gchar *hostname) { ScreenInfo *screen_info; DisplayInfo *display_info; - gchar *title; g_return_val_if_fail (c != NULL, NULL); TRACE ("entering clientCreateTitleName"); @@ -178,6 +179,14 @@ clientCreateTitleName (Client *c, gchar *name, gchar *hostname) screen_info = c->screen_info; display_info = screen_info->display_info; + return clientCreateNameWithHost (display_info, name, hostname); +} + +static gchar* +clientCreateNameWithHost(DisplayInfo *display_info, gchar *name, gchar *hostname) +{ + gchar *title; + if (strlen (hostname) && (display_info->hostname) && (g_ascii_strcasecmp (display_info->hostname, hostname))) { /* TRANSLATORS: "(on %s)" is like "running on" the name of the other host */ @@ -1484,6 +1493,7 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture) unsigned long valuemask; long pid; int i; + gchar *name; g_return_val_if_fail (w != None, NULL); g_return_val_if_fail (display_info != NULL, NULL); @@ -1566,6 +1576,12 @@ clientFrame (DisplayInfo *display_info, Window w, gboolean recapture) getTransientFor (display_info, screen_info->xroot, c->window, &c->transient_for); XChangeSaveSet(display_info->dpy, c->window, SetModeInsert); + if (c->name) { + name = clientCreateNameWithHost (display_info, c->name, c->hostname); + g_free (c->name); + c->name = name; + } + /* Initialize structure */ c->size = NULL; c->flags = 0L; -- 1.7.9.5