/* update the list hints */
client_set_list();
+ /* watch for when the application stops responding. only do this for
+ normal windows, i.e. windows which have titlebars and close buttons
+ and things like that */
+ if (self->ping && client_normal(self))
+ ping_start(self, client_ping_event);
+
/* free the ObAppSettings shallow copy */
g_free(settings);
/* remove the window from our save set */
XChangeSaveSet(ob_display, self->window, SetModeDelete);
+ /* stop pinging the window */
+ if (self->ping && client_normal(self))
+ ping_stop(self);
+
/* update the focus lists */
focus_order_remove(self);
if (client_focused(self)) {
if (self->not_responding) {
data = visible;
- visible = g_strdup_printf("%s - [%s]", data, _("Not Responding"));
+ if (self->close_tried_term)
+ visible = g_strdup_printf("%s - [%s]", data, _("Killing..."));
+ else
+ visible = g_strdup_printf("%s - [%s]", data, _("Not Responding"));
g_free(data);
}
if (self->not_responding) {
data = visible;
- visible = g_strdup_printf("%s - [%s]", data, _("Not Responding"));
+ if (self->close_tried_term)
+ visible = g_strdup_printf("%s - [%s]", data, _("Killing..."));
+ else
+ visible = g_strdup_printf("%s - [%s]", data, _("Not Responding"));
g_free(data);
}
{
self->not_responding = dead;
client_update_title(self);
+
+ if (!dead) {
+ /* try kill it nicely the first time again, if it started responding
+ at some point */
+ self->close_tried_term = FALSE;
+ }
}
void client_close(ObClient *self)
XKillClient(ob_display, self->window);
else if (self->not_responding)
client_kill(self);
- else {
+ else
+ /* request the client to close with WM_DELETE_WINDOW */
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)
{
if (!self->client_machine && self->pid) {
/* running on the local host */
- if (!self->kill_tried_term) {
+ if (!self->close_tried_term) {
+ ob_debug("killing window 0x%x with pid %lu, with SIGTERM\n",
+ self->window, self->pid);
kill(self->pid, SIGTERM);
- self->kill_tried_term = TRUE;
+ self->close_tried_term = TRUE;
+
+ /* show that we're trying to kill it */
+ client_update_title(self);
}
- else
+ else {
+ ob_debug("killing window 0x%x with pid %lu, with SIGKILL\n",
+ self->window, self->pid);
kill(self->pid, SIGKILL); /* kill -9 */
+ }
}
else
XKillClient(ob_display, self->window);