X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=inline;f=openbox%2Fclient.c;h=2b9d53725680e292d3ebdc813a827fce4b2b128b;hb=141c249b8cd3b94a722acc8c0225b3cbf83e5042;hp=e7af570150a7040868231c41851ef0f8fb889c54;hpb=a70633d42af849e4de2288ec48fa6abe726a484e;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index e7af5701..2b9d5372 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -70,6 +70,7 @@ static void client_get_layer(ObClient *self); static void client_get_shaped(ObClient *self); static void client_get_mwm_hints(ObClient *self); static void client_get_gravity(ObClient *self); +static void client_get_client_machine(ObClient *self); static void client_change_allowed_actions(ObClient *self); static void client_change_state(ObClient *self); static void client_change_wm_state(ObClient *self); @@ -506,15 +507,18 @@ void client_unmanage(ObClient *self) g_assert(self != NULL); + /* we dont want events no more. do this before hiding the frame so we + don't generate more events */ + XSelectInput(ob_display, self->window, NoEventMask); + frame_hide(self->frame); - XSync(ob_display, FALSE); + /* flush to send the hide to the server quickly */ + XFlush(ob_display); if (focus_client == self) { - XEvent e; - - /* focus the last focused window on the desktop, and ignore enter - events from the unmap so it doesnt mess with the focus */ - while (XCheckTypedEvent(ob_display, EnterNotify, &e)); + /* ignore enter events from the unmap so it doesnt mess with the focus + */ + event_ignore_queued_enters(); } @@ -524,9 +528,6 @@ void client_unmanage(ObClient *self) /* remove the window from our save set */ XChangeSaveSet(ob_display, self->window, SetModeDelete); - /* we dont want events no more */ - XSelectInput(ob_display, self->window, NoEventMask); - /* update the focus lists */ focus_order_remove(self); @@ -624,6 +625,7 @@ void client_unmanage(ObClient *self) g_free(self->name); g_free(self->class); g_free(self->role); + g_free(self->client_machine); g_free(self->sm_client_id); g_free(self); @@ -933,6 +935,7 @@ static void client_get_all(ObClient *self) (min/max sizes), so we're ready to set up the decorations/functions */ client_setup_decor_and_functions(self); + client_get_client_machine(self); client_update_title(self); client_update_class(self); client_update_sm_client_id(self); @@ -1641,6 +1644,7 @@ void client_update_wmhints(ObClient *self) void client_update_title(ObClient *self) { gchar *data = NULL; + gchar *visible = NULL; g_free(self->title); @@ -1660,8 +1664,14 @@ void client_update_title(ObClient *self) } } - PROP_SETS(self->window, net_wm_visible_name, data); - self->title = data; + if (self->client_machine) { + visible = g_strdup_printf("%s (%s)", data, self->client_machine); + g_free(data); + } else + visible = data; + + PROP_SETS(self->window, net_wm_visible_name, visible); + self->title = visible; if (self->frame) frame_adjust_title(self->frame); @@ -1860,6 +1870,21 @@ void client_update_user_time(ObClient *self) } } +static void client_get_client_machine(ObClient *self) +{ + gchar *data = NULL; + gchar localhost[128]; + + g_free(self->client_machine); + + if (PROP_GETS(self->window, wm_client_machine, locale, &data)) { + gethostname(localhost, 127); + localhost[127] = '\0'; + if (strcmp(localhost, data)) + self->client_machine = data; + } +} + static void client_change_wm_state(ObClient *self) { gulong state[2];