all repos — openbox @ d3e9fc8941831477b50678b9bd676e29f4bed1a7

openbox fork - make it a bit more like ryudo

show [Not Responding] in the titlebar when closing an app and it stops responding to pings
Dana Jansens danakj@orodu.net
commit

d3e9fc8941831477b50678b9bd676e29f4bed1a7

parent

fb7a71da202632c7301ada67c8b4420bfb8d8fbe

3 files changed, 23 insertions(+), 5 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -40,6 +40,7 @@ #include "menuframe.h"

#include "keyboard.h" #include "mouse.h" #include "render/render.h" +#include "gettext.h" #ifdef HAVE_UNISTD_H # include <unistd.h>

@@ -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 @@ g_free(data);

} 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;

@@ -1969,6 +1977,12 @@ visible = g_strdup_printf("%s (%s)", data, self->client_machine);

g_free(data); } 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;

@@ -3168,10 +3182,8 @@ }

static void client_ping_event(ObClient *self, gboolean dead) { - if (dead) - ob_debug("client 0x%x window 0x%x is not responding !!\n"); - else - ob_debug("client 0x%x window 0x%x started responding again..\n"); + self->not_responding = dead; + client_update_title(self); } void client_close(ObClient *self)

@@ -3195,7 +3207,8 @@ PROP_MSG_TO(self->window, self->window, wm_protocols,

prop_atoms.wm_delete_window, event_curtime, 0, 0, 0, NoEventMask); - ping_start(self, client_ping_event); + if (self->ping) + ping_start(self, client_ping_event); } void client_kill(ObClient *self)
M openbox/client.hopenbox/client.h

@@ -222,6 +222,9 @@ gboolean focus_notify;

/*! Will the client respond to pings? */ gboolean ping; + /*! Indicates if the client is trying to close but has stopped responding + to pings */ + gboolean not_responding; #ifdef SYNC /*! The client wants to sync during resizes */
M openbox/ping.copenbox/ping.c

@@ -48,6 +48,8 @@ {

GSList *it; ObPingTarget *t; + g_assert(client->ping == TRUE); + /* make sure we're not already pinging it */ for (it = ping_targets; it != NULL; it = g_slist_next(it)) { t = it->data;