From: Michael Stapelberg Date: Sat, 11 Apr 2009 17:06:26 +0000 (+0200) Subject: Bugfix: Don’t only check for the currently active screen, but check for all screens... X-Git-Tag: 3.a-bf1~43 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=713397430600edc9add8619e953dc8ea1d08b2f5;p=i3%2Fi3 Bugfix: Don’t only check for the currently active screen, but check for all screens (Thanks Mirko) --- diff --git a/src/handlers.c b/src/handlers.c index 42f3b947..7ca05686 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -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; }