Implement assignments of workspaces to screens, big cleanup of workspace code

Please test this! Plug in screens, unplug them, use your video projector,
change resolutions, etc.

To use the assignments, use the following syntax:
workspace <number> [screen <screen>] [name]

Where screen can be one of:
<number> (It is not provided that these numbers stay constant, so use with care)
<x>x<y> (Coordinates where the screen starts, so 1280 will be fine to match the
	 screen right of the main screen if your main screen is 1280 pixels
	 width. However, 1281 will not match)
<x>
x<y>

Some examples follow:

 workspace 1 screen 0
 workspace 1 screen 1
 workspace 1 screen 1280x0
 workspace 2 screen 1280
 workspace 3 screen x0
 workspace 3 screen 1 www
 workspace 4 screen 0 mail
This commit is contained in:
Michael Stapelberg
2009-08-08 19:51:51 +02:00
parent 6192975a04
commit 47a798ac4a
14 changed files with 469 additions and 257 deletions

View File

@ -342,12 +342,7 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
LOG("Changing container/workspace and unmapping the client\n");
Workspace *t_ws = &(workspaces[assign->workspace-1]);
if (t_ws->screen == NULL) {
LOG("initializing new workspace, setting num to %d\n", assign->workspace);
t_ws->screen = c_ws->screen;
/* Copy the dimensions from the virtual screen */
memcpy(&(t_ws->rect), &(t_ws->screen->rect), sizeof(Rect));
}
workspace_initialize(t_ws, c_ws->screen);
new->container = t_ws->table[t_ws->current_col][t_ws->current_row];
new->workspace = t_ws;
@ -445,8 +440,10 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
/* Map the window first to avoid flickering */
xcb_map_window(conn, child);
if (map_frame)
if (map_frame) {
LOG("Mapping client\n");
xcb_map_window(conn, new->frame);
}
if (CUR_CELL->workspace->fullscreen_client == NULL && !new->dock) {
/* Focus the new window if were not in fullscreen mode and if it is not a dock window */
if (new->workspace->fullscreen_client == NULL) {