]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Correctly remove client from container when moving to another workspace
authorMichael Stapelberg <michael+x200@stapelberg.de>
Wed, 1 Apr 2009 10:02:22 +0000 (12:02 +0200)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Wed, 1 Apr 2009 10:02:22 +0000 (12:02 +0200)
This fixes ticket #16

src/commands.c
src/handlers.c
src/util.c

index 3a27a11777c244ed784b8db1f59e07f00b01ee11..36589b10fd7459e37e575ff9e6e9f4fcad42f2b7 100644 (file)
@@ -219,6 +219,7 @@ static void move_current_window(xcb_connection_t *conn, direction_t direction) {
         /* Remove it from the old container and put it into the new one */
         remove_client_from_container(conn, current_client, container);
         CIRCLEQ_INSERT_TAIL(&(new->clients), current_client, clients);
+        SLIST_INSERT_HEAD(&(new->workspace->focus_stack), current_client, focus_clients);
 
         /* Update data structures */
         current_client->container = new;
@@ -424,8 +425,7 @@ static void move_current_window_to_workspace(xcb_connection_t *conn, int workspa
 
         assert(to_container != NULL);
 
-        CIRCLEQ_REMOVE(&(container->clients), current_client, clients);
-        SLIST_REMOVE(&(container->workspace->focus_stack), current_client, Client, focus_clients);
+        remove_client_from_container(conn, current_client, container);
 
         CIRCLEQ_INSERT_TAIL(&(to_container->clients), current_client, clients);
         SLIST_INSERT_HEAD(&(to_container->workspace->focus_stack), current_client, focus_clients);
index 7f4b491cf3a2bad4de8b80de45ac6f8245aa8ace..e912350cb6f11d4cb58e33c6fe088d13b6ef59e8 100644 (file)
@@ -586,10 +586,6 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
                 /* Remove the client from the list of clients */
                 remove_client_from_container(conn, client, con);
 
-                /* Remove from the focus stack */
-                LOG("Removing from focus stack\n");
-                SLIST_REMOVE(&(con->workspace->focus_stack), client, Client, focus_clients);
-
                 /* Set focus to the last focused client in this container */
                 con->currently_focused = NULL;
                 Client *focus_client;
index d38e4e8a283bc58e88e7a960df3dd2706eac3dea..24c42912e60d022930a46b8d14582769ec9952f9 100644 (file)
@@ -191,6 +191,8 @@ char *convert_utf8_to_ucs2(char *input, int *real_strlen) {
 void remove_client_from_container(xcb_connection_t *conn, Client *client, Container *container) {
         CIRCLEQ_REMOVE(&(container->clients), client, clients);
 
+        SLIST_REMOVE(&(container->workspace->focus_stack), client, Client, focus_clients);
+
         /* If the container will be empty now and is in stacking mode, we need to
            unmap the stack_win */
         if (CIRCLEQ_EMPTY(&(container->clients)) && container->mode == MODE_STACK) {