* one or because it was unmapped
*
*/
-void client_remove_from_container(xcb_connection_t *conn, Client *client, Container *container);
+void client_remove_from_container(xcb_connection_t *conn, Client *client, Container *container, bool remove_from_focusstack);
/**
* Warps the pointer into the given client (in the middle of it, to be specific), therefore
* one or because it was unmapped
*
*/
-void client_remove_from_container(xcb_connection_t *conn, Client *client, Container *container) {
+void client_remove_from_container(xcb_connection_t *conn, Client *client, Container *container, bool remove_from_focusstack) {
CIRCLEQ_REMOVE(&(container->clients), client, clients);
- SLIST_REMOVE(&(container->workspace->focus_stack), client, Client, focus_clients);
+ if (remove_from_focusstack)
+ 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 */
}
/* Remove it from the old container and put it into the new one */
- client_remove_from_container(conn, current_client, container);
+ client_remove_from_container(conn, current_client, container, true);
if (new->currently_focused != NULL)
CIRCLEQ_INSERT_AFTER(&(new->clients), new->currently_focused, current_client, clients);
assert(to_container != NULL);
- client_remove_from_container(conn, current_client, container);
+ client_remove_from_container(conn, current_client, container, true);
if (container->workspace->fullscreen_client == current_client)
container->workspace->fullscreen_client = NULL;
#include "xcb.h"
#include "debug.h"
#include "layout.h"
+#include "client.h"
/* On which border was the dragging initiated? */
typedef enum { BORDER_LEFT, BORDER_RIGHT, BORDER_TOP, BORDER_BOTTOM} border_t;
LOG("Entering floating for client %08x\n", client->child);
/* Remove the client of its container */
- CIRCLEQ_REMOVE(&(con->clients), client, clients);
+ client_remove_from_container(conn, client, con, false);
client->container = NULL;
if (con->currently_focused == client) {
con->workspace->fullscreen_client = NULL;
/* Remove the client from the list of clients */
- client_remove_from_container(conn, client, con);
+ client_remove_from_container(conn, client, con, true);
/* Set focus to the last focused client in this container */
con->currently_focused = get_last_focused_client(conn, con, NULL);