Bugfix: Re-assign dock windows to different workspaces when a workspace is deleted
Killing a dock client and having destroyed workspace 1 before (or the workspace on which the dock client was started when it was not auto-started) crashed i3 before this bugfix.
This commit is contained in:
12
src/util.c
12
src/util.c
@ -263,8 +263,18 @@ void unmap_workspace(xcb_connection_t *conn, Workspace *u_ws) {
|
||||
}
|
||||
|
||||
/* If we did not unmap any clients, the workspace is empty and we can destroy it */
|
||||
if (unmapped_clients == 0)
|
||||
if (unmapped_clients == 0) {
|
||||
/* Re-assign the workspace of all dock clients which use this workspace */
|
||||
Client *dock;
|
||||
SLIST_FOREACH(dock, &(u_ws->screen->dock_clients), dock_clients) {
|
||||
if (dock->workspace != u_ws)
|
||||
continue;
|
||||
|
||||
LOG("Re-assigning dock client to c_ws (%p)\n", c_ws);
|
||||
dock->workspace = c_ws;
|
||||
}
|
||||
u_ws->screen = NULL;
|
||||
}
|
||||
|
||||
/* Unmap the stack windows on the current workspace, if any */
|
||||
SLIST_FOREACH(stack_win, &stack_wins, stack_windows)
|
||||
|
Reference in New Issue
Block a user