X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=a4d045dcd0903bb0bddb240e5b556a40421a90c2;hb=d3e9fc8941831477b50678b9bd676e29f4bed1a7;hp=7019f690086e16f881a3a2efd0a3c24aaed31a47;hpb=d790dc162d24cfdcc236114b50c51af62612646a;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 7019f690..a4d045dc 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -40,6 +40,7 @@ #include "keyboard.h" #include "mouse.h" #include "render/render.h" +#include "gettext.h" #ifdef HAVE_UNISTD_H # include @@ -93,6 +94,7 @@ static GSList *client_search_all_top_parents_internal(ObClient *self, gboolean bylayer, ObStackingLayer layer); static void client_call_notifies(ObClient *self, GSList *list); +static void client_ping_event(ObClient *self, gboolean dead); void client_startup(gboolean reconfig) @@ -1947,6 +1949,12 @@ void client_update_title(ObClient *self) } else visible = data; + if (self->not_responding) { + data = visible; + visible = g_strdup_printf("%s - [%s]", data, _("Not Responding")); + g_free(data); + } + PROP_SETS(self->window, net_wm_visible_name, visible); self->title = visible; @@ -1970,6 +1978,12 @@ void client_update_title(ObClient *self) } else visible = data; + if (self->not_responding) { + data = visible; + visible = g_strdup_printf("%s - [%s]", data, _("Not Responding")); + g_free(data); + } + PROP_SETS(self->window, net_wm_visible_icon_name, visible); self->icon_title = visible; } @@ -3166,10 +3180,14 @@ void client_shade(ObClient *self, gboolean shade) frame_adjust_area(self->frame, FALSE, TRUE, FALSE); } -void client_close(ObClient *self) +static void client_ping_event(ObClient *self, gboolean dead) { - XEvent ce; + self->not_responding = dead; + client_update_title(self); +} +void client_close(ObClient *self) +{ if (!(self->functions & OB_CLIENT_FUNC_CLOSE)) return; /* in the case that the client provides no means to requesting that it @@ -3185,17 +3203,12 @@ void client_close(ObClient *self) explicitly killed. */ - ce.xclient.type = ClientMessage; - ce.xclient.message_type = prop_atoms.wm_protocols; - ce.xclient.display = ob_display; - ce.xclient.window = self->window; - ce.xclient.format = 32; - ce.xclient.data.l[0] = prop_atoms.wm_delete_window; - ce.xclient.data.l[1] = event_curtime; - ce.xclient.data.l[2] = 0l; - ce.xclient.data.l[3] = 0l; - ce.xclient.data.l[4] = 0l; - XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce); + PROP_MSG_TO(self->window, self->window, wm_protocols, + prop_atoms.wm_delete_window, event_curtime, 0, 0, 0, + NoEventMask); + + if (self->ping) + ping_start(self, client_ping_event); } void client_kill(ObClient *self)