]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t only check for the currently active screen, but check for all screens...
authorMichael Stapelberg <michael+x200@stapelberg.de>
Sat, 11 Apr 2009 17:06:26 +0000 (19:06 +0200)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Sat, 11 Apr 2009 17:06:26 +0000 (19:06 +0200)
src/handlers.c

index 42f3b947fe412ec9ff088844ddfe4c5caef0b860..7ca0568684efd62cb6afbf0d19fc53d16a31fbbc 100644 (file)
@@ -645,7 +645,14 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
                         break;
                 }
 
-        if (workspace_empty && (c_ws != client->workspace))
+        i3Screen *screen;
+        TAILQ_FOREACH(screen, virtual_screens, screens)
+                if (screen->current_workspace == client->workspace->num) {
+                        workspace_empty = false;
+                        break;
+                }
+
+        if (workspace_empty)
                 client->workspace->screen = NULL;
 
         free(client);
@@ -799,11 +806,9 @@ int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *
 
                 /* …or one of the bars? */
                 i3Screen *screen;
-                TAILQ_FOREACH(screen, virtual_screens, screens) {
-                        if (screen->bar == event->window) {
+                TAILQ_FOREACH(screen, virtual_screens, screens)
+                        if (screen->bar == event->window)
                                 render_layout(conn);
-                        }
-                }
                 return 1;
         }