]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
can tell when a window that was "closed" has stopped responding now
[chaz/openbox] / openbox / client.c
index 7019f690086e16f881a3a2efd0a3c24aaed31a47..0f592ebe72df9595c79d22840252039f124cf171 100644 (file)
@@ -3166,10 +3166,16 @@ 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;
+    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");
+}
 
+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 +3191,11 @@ 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);
+
+    ping_start(self, client_ping_event);
 }
 
 void client_kill(ObClient *self)
This page took 0.020337 seconds and 4 git commands to generate.