]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: when a window is unmapped, correctly pass focus to the next one and cleanup...
authorMichael Stapelberg <michael+git@stapelberg.de>
Wed, 25 Feb 2009 00:44:34 +0000 (01:44 +0100)
committerMichael Stapelberg <michael+git@stapelberg.de>
Wed, 25 Feb 2009 00:44:34 +0000 (01:44 +0100)
i3.config
src/handlers.c

index 0e5ff21ba063fc320519112e3a72ee782c1d0a19..4a9468b0023af2f761d56e52dfaa90fa8f27928c 100644 (file)
--- a/i3.config
+++ b/i3.config
@@ -39,3 +39,5 @@ bind Mod1+16 7
 bind Mod1+17 8
 bind Mod1+18 9
 bind Mod1+19 0
+
+bind Mod1+36 exec /usr/pkg/bin/urxvt
index e1edd5c64c159195deea5a48797046b3eff006d2..04f427dbf7781bb949a909572ebfaea2c0542cc6 100644 (file)
@@ -329,9 +329,13 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_
         }
 
         if (client->container != NULL) {
+                Client *to_focus = CIRCLEQ_NEXT_OR_NULL(&(client->container->clients), client, clients);
+                if (to_focus == NULL)
+                        to_focus = CIRCLEQ_PREV_OR_NULL(&(client->container->clients), client, clients);
                 if (client->container->currently_focused == client)
-                        client->container->currently_focused = NULL;
+                        client->container->currently_focused = to_focus;
                 CIRCLEQ_REMOVE(&(client->container->clients), client, clients);
+                set_focus(c, to_focus);
         }
 
         printf("child of 0x%08x.\n", client->frame);
@@ -339,6 +343,9 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *c, xcb_unmap_notify_
         xcb_destroy_window(c, client->frame);
         xcb_flush(c);
         table_remove(byParent, client->frame);
+
+        cleanup_table(client->container->workspace);
+
         free(client);
 
         render_layout(c);