show [Not Responding] in the titlebar when closing an app and it stops responding to pings
This commit is contained in:
parent
fb7a71da20
commit
d3e9fc8941
3 changed files with 23 additions and 5 deletions
|
@ -40,6 +40,7 @@
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "mouse.h"
|
#include "mouse.h"
|
||||||
#include "render/render.h"
|
#include "render/render.h"
|
||||||
|
#include "gettext.h"
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
@ -93,6 +94,7 @@ static GSList *client_search_all_top_parents_internal(ObClient *self,
|
||||||
gboolean bylayer,
|
gboolean bylayer,
|
||||||
ObStackingLayer layer);
|
ObStackingLayer layer);
|
||||||
static void client_call_notifies(ObClient *self, GSList *list);
|
static void client_call_notifies(ObClient *self, GSList *list);
|
||||||
|
static void client_ping_event(ObClient *self, gboolean dead);
|
||||||
|
|
||||||
|
|
||||||
void client_startup(gboolean reconfig)
|
void client_startup(gboolean reconfig)
|
||||||
|
@ -1947,6 +1949,12 @@ void client_update_title(ObClient *self)
|
||||||
} else
|
} else
|
||||||
visible = data;
|
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);
|
PROP_SETS(self->window, net_wm_visible_name, visible);
|
||||||
self->title = visible;
|
self->title = visible;
|
||||||
|
|
||||||
|
@ -1970,6 +1978,12 @@ void client_update_title(ObClient *self)
|
||||||
} else
|
} else
|
||||||
visible = data;
|
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);
|
PROP_SETS(self->window, net_wm_visible_icon_name, visible);
|
||||||
self->icon_title = visible;
|
self->icon_title = visible;
|
||||||
}
|
}
|
||||||
|
@ -3168,10 +3182,8 @@ void client_shade(ObClient *self, gboolean shade)
|
||||||
|
|
||||||
static void client_ping_event(ObClient *self, gboolean dead)
|
static void client_ping_event(ObClient *self, gboolean dead)
|
||||||
{
|
{
|
||||||
if (dead)
|
self->not_responding = dead;
|
||||||
ob_debug("client 0x%x window 0x%x is not responding !!\n");
|
client_update_title(self);
|
||||||
else
|
|
||||||
ob_debug("client 0x%x window 0x%x started responding again..\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_close(ObClient *self)
|
void client_close(ObClient *self)
|
||||||
|
@ -3195,6 +3207,7 @@ void client_close(ObClient *self)
|
||||||
prop_atoms.wm_delete_window, event_curtime, 0, 0, 0,
|
prop_atoms.wm_delete_window, event_curtime, 0, 0, 0,
|
||||||
NoEventMask);
|
NoEventMask);
|
||||||
|
|
||||||
|
if (self->ping)
|
||||||
ping_start(self, client_ping_event);
|
ping_start(self, client_ping_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,6 +222,9 @@ struct _ObClient
|
||||||
|
|
||||||
/*! Will the client respond to pings? */
|
/*! Will the client respond to pings? */
|
||||||
gboolean ping;
|
gboolean ping;
|
||||||
|
/*! Indicates if the client is trying to close but has stopped responding
|
||||||
|
to pings */
|
||||||
|
gboolean not_responding;
|
||||||
|
|
||||||
#ifdef SYNC
|
#ifdef SYNC
|
||||||
/*! The client wants to sync during resizes */
|
/*! The client wants to sync during resizes */
|
||||||
|
|
|
@ -48,6 +48,8 @@ void ping_start(struct _ObClient *client, ObPingEventHandler h)
|
||||||
GSList *it;
|
GSList *it;
|
||||||
ObPingTarget *t;
|
ObPingTarget *t;
|
||||||
|
|
||||||
|
g_assert(client->ping == TRUE);
|
||||||
|
|
||||||
/* make sure we're not already pinging it */
|
/* make sure we're not already pinging it */
|
||||||
for (it = ping_targets; it != NULL; it = g_slist_next(it)) {
|
for (it = ping_targets; it != NULL; it = g_slist_next(it)) {
|
||||||
t = it->data;
|
t = it->data;
|
||||||
|
|
Loading…
Reference in a new issue