Bugfix: Force reconfiguration of all windows on workspaces which needed to be re-assigned (Thanks Mirko)

When you disable a Xinerama screen (think of removing a video projector),
the workspaces of that screen need to be re-assigned to another screen.
Previously, the clients affected by this re-assignment did not get re-
configured, which made them appear on the next screen which got configured
at the position of the old one again if you did not switch to the reassigned
workspace before.

So, to reproduce it:
xrandr --output VGA --mode 1280x1024 --right-of LVDS
move windows to the new workspace
xrandr --output VGA --off
xrandr --output VGA --mode 1280x1024 --right-of LVDS

This fixes ticket #36
This commit is contained in:
Michael Stapelberg
2009-05-09 13:01:23 +02:00
parent 89076ea7cf
commit 18da0a3017
6 changed files with 157 additions and 103 deletions

View File

@ -527,30 +527,8 @@ void show_workspace(xcb_connection_t *conn, int workspace) {
t_ws->screen->current_workspace = workspace-1;
/* TODO: does grabbing the server actually bring us any (speed)advantages? */
//xcb_grab_server(conn);
ignore_enter_notify_forall(conn, c_ws, true);
/* Unmap all clients of the current workspace */
int unmapped_clients = 0;
FOR_TABLE(c_ws)
CIRCLEQ_FOREACH(client, &(c_ws->table[cols][rows]->clients), clients) {
xcb_unmap_window(conn, client->frame);
unmapped_clients++;
}
/* If we did not unmap any clients, the workspace is empty and we can destroy it */
if (unmapped_clients == 0)
c_ws->screen = NULL;
/* Unmap the stack windows on the current workspace, if any */
struct Stack_Window *stack_win;
SLIST_FOREACH(stack_win, &stack_wins, stack_windows)
if (stack_win->container->workspace == c_ws)
xcb_unmap_window(conn, stack_win->window);
ignore_enter_notify_forall(conn, c_ws, false);
unmap_workspace(conn, c_ws);
c_ws = &workspaces[workspace-1];
current_row = c_ws->current_row;
@ -565,6 +543,7 @@ void show_workspace(xcb_connection_t *conn, int workspace) {
xcb_map_window(conn, client->frame);
/* Map all stack windows, if any */
struct Stack_Window *stack_win;
SLIST_FOREACH(stack_win, &stack_wins, stack_windows)
if (stack_win->container->workspace == c_ws)
xcb_map_window(conn, stack_win->window);
@ -580,8 +559,6 @@ void show_workspace(xcb_connection_t *conn, int workspace) {
}
} else xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, root, XCB_CURRENT_TIME);
//xcb_ungrab_server(conn);
render_layout(conn);
}