]> git.sur5r.net Git - i3/i3/commitdiff
handle destroynotify events
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Apr 2010 15:27:53 +0000 (17:27 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Apr 2010 15:27:53 +0000 (17:27 +0200)
include/handlers.h
src/handlers.c
src/nc.c

index 270822b834d49455e420fab88e3e710d2c623cec..12d64c48edc958f75c99ea7280f657666e540f4f 100644 (file)
@@ -97,7 +97,7 @@ int handle_configure_request(void *prophs, xcb_connection_t *conn,
  *
  */
 int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event);
-#if 0
+
 /**
  * A destroy notify event is sent when the window is not unmapped, but
  * immediately destroyed (for example when starting a window and immediately
@@ -110,7 +110,6 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
 int handle_destroy_notify_event(void *data, xcb_connection_t *conn,
                                 xcb_destroy_notify_event_t *event);
 
-#endif
 /**
  * Called when a window changes its title
  *
index 0d2f10bf95504155fe08b5b1d7bbd912bb18b470..535d963eaad82ce6af1b1f8d472b6170eecad378 100644 (file)
@@ -507,7 +507,6 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
         return 1;
 }
 
-#if 0
 /*
  * A destroy notify event is sent when the window is not unmapped, but
  * immediately destroyed (for example when starting a window and immediately
@@ -518,16 +517,16 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
  *
  */
 int handle_destroy_notify_event(void *data, xcb_connection_t *conn, xcb_destroy_notify_event_t *event) {
-        DLOG("destroy notify for 0x%08x, 0x%08x\n", event->event, event->window);
+    DLOG("destroy notify for 0x%08x, 0x%08x\n", event->event, event->window);
 
-        xcb_unmap_notify_event_t unmap;
-        unmap.sequence = event->sequence;
-        unmap.event = event->event;
-        unmap.window = event->window;
+    xcb_unmap_notify_event_t unmap;
+    unmap.sequence = event->sequence;
+    unmap.event = event->event;
+    unmap.window = event->window;
 
-        return handle_unmap_notify_event(NULL, conn, &unmap);
+    return handle_unmap_notify_event(NULL, conn, &unmap);
 }
-#endif
+
 /*
  * Called when a window changes its title
  *
index 869a6f866188314281c72aff5c05711302dcaa10..8cd325a84cc9ffad96b0e31beaf80ee62555b651 100644 (file)
--- a/src/nc.c
+++ b/src/nc.c
@@ -272,7 +272,7 @@ int main(int argc, char *argv[]) {
     xcb_event_set_map_request_handler(&evenths, handle_map_request, NULL);
 
     xcb_event_set_unmap_notify_handler(&evenths, handle_unmap_notify_event, NULL);
-    //xcb_event_set_destroy_notify_handler(&evenths, handle_destroy_notify_event, NULL);
+    xcb_event_set_destroy_notify_handler(&evenths, handle_destroy_notify_event, NULL);
 
     xcb_event_set_expose_handler(&evenths, handle_expose_event, NULL);