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 8c6c4270a9
commit d24e47a0f3
6 changed files with 159 additions and 105 deletions

View File

@ -51,6 +51,12 @@ void render_container(xcb_connection_t *conn, Container *container);
*/
void ignore_enter_notify_forall(xcb_connection_t *conn, Workspace *workspace, bool ignore_enter_notify);
/**
* Renders the given workspace on the given screen
*
*/
void render_workspace(xcb_connection_t *conn, i3Screen *screen, Workspace *r_ws);
/**
* Renders the whole layout, that is: Go through each screen, each workspace, each container
* and render each client. This also renders the bars.

View File

@ -22,8 +22,8 @@
#define CIRCLEQ_PREV_OR_NULL(head, elm, field) (CIRCLEQ_PREV(elm, field) != CIRCLEQ_END(head) ? \
CIRCLEQ_PREV(elm, field) : NULL)
#define FOR_TABLE(workspace) \
for (int cols = 0; cols < workspace->cols; cols++) \
for (int rows = 0; rows < workspace->rows; rows++)
for (int cols = 0; cols < (workspace)->cols; cols++) \
for (int rows = 0; rows < (workspace)->rows; rows++)
#define FREE(pointer) do { \
if (pointer == NULL) { \
free(pointer); \
@ -137,6 +137,17 @@ void remove_client_from_container(xcb_connection_t *conn, Client *client, Contai
*/
Client *get_last_focused_client(xcb_connection_t *conn, Container *container, Client *exclude);
/**
* Unmaps all clients (and stack windows) of the given workspace.
*
* This needs to be called separately when temporarily rendering
* a workspace which is not the active workspace to force
* reconfiguration of all clients, like in src/xinerama.c when
* re-assigning a workspace to another screen.
*
*/
void unmap_workspace(xcb_connection_t *conn, Workspace *u_ws);
/**
* Sets the given client as focused by updating the data structures correctly,
* updating the X input focus and finally re-decorating both windows (to signalize