/* 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;
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);
/* 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;
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) {