]> git.sur5r.net Git - i3/i3/commitdiff
Ignore UnmapNotify events generated by reparenting
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 14 May 2010 21:37:56 +0000 (23:37 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 14 May 2010 21:37:56 +0000 (23:37 +0200)
src/handlers.c
src/manage.c

index 4921fdea0b76123d0508200ded5055e7cf32db13..ecaba2197908f385c38cf8aaccb6bb63404f1e0c 100644 (file)
@@ -451,11 +451,17 @@ int handle_screen_change(void *prophs, xcb_connection_t *conn,
  */
 int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) {
 
+    bool ignored = event_is_ignored(event->sequence);
+
     /* we need to ignore EnterNotify events which will be generated because a
      * different window is visible now */
     add_ignore_event(event->sequence);
 
     DLOG("UnmapNotify for 0x%08x (received from 0x%08x), serial %d\n", event->window, event->event, event->sequence);
+    if (ignored) {
+        DLOG("Ignoring UnmapNotify (generated by reparenting)\n");
+        return 1;
+    }
     Con *con = con_by_window_id(event->window);
     if (con == NULL) {
         LOG("Not a managed window, ignoring\n");
index b1b9e9d69f9cc14c28eb3e78b8abe1eb6952a30d..7983baaccab889be22a1af75867502c5c3cd217f 100644 (file)
@@ -171,6 +171,9 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
         goto out;
     }
 
+    LOG("ignoring sequence %d for reparenting!\n", rcookie.sequence);
+    add_ignore_event(rcookie.sequence);
+
     xcb_get_property_reply_t *reply = xcb_get_property_reply(conn, state_cookie, NULL);
     if (xcb_reply_contains_atom(reply, atoms[_NET_WM_STATE_FULLSCREEN]))
         con_toggle_fullscreen(nc);