]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: handle MapRequests sent between i3 registering as a wm and handling events
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 24 Dec 2012 13:49:19 +0000 (14:49 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 24 Dec 2012 13:49:19 +0000 (14:49 +0100)
This fixes the problem where i3-nagbar does not come up because its
MapRequest is ignored.

fixes #892

src/main.c

index 6d0f80cb124c44cbd1956d89fb87da56db036eb6..cb6767fbb761b8d2bd61a87e8ddfe191c88b1f31 100644 (file)
@@ -777,6 +777,20 @@ int main(int argc, char *argv[]) {
         xcb_aux_sync(conn);
         xcb_generic_event_t *event;
         while ((event = xcb_poll_for_event(conn)) != NULL) {
+            if (event->response_type == 0) {
+                free(event);
+                continue;
+            }
+
+            /* Strip off the highest bit (set if the event is generated) */
+            int type = (event->response_type & 0x7F);
+
+            /* We still need to handle MapRequests which are sent in the
+             * timespan starting from when we register as a window manager and
+             * this piece of code which drops events. */
+            if (type == XCB_MAP_REQUEST)
+                handle_event(type, event);
+
             free(event);
         }
         manage_existing_windows(root);