Bugfix: Store dock clients per screen, not per workspace.

This fixes ticket #12
next
Michael Stapelberg 2009-04-11 14:29:15 +02:00
parent 8cc1fcf536
commit bcbe800720
6 changed files with 12 additions and 8 deletions

View File

@ -143,9 +143,6 @@ struct Workspace {
Client *fullscreen_client;
/* Contains all clients with _NET_WM_WINDOW_TYPE == _NET_WM_WINDOW_TYPE_DOCK */
SLIST_HEAD(dock_clients_head, Client) dock_clients;
/* The focus stack contains the clients in the correct order of focus so that
the focus can be reverted correctly when a client is closed */
SLIST_HEAD(focus_stack_head, Client) focus_stack;
@ -317,6 +314,9 @@ struct Screen {
xcb_window_t bar;
xcb_gcontext_t bargc;
/* Contains all clients with _NET_WM_WINDOW_TYPE == _NET_WM_WINDOW_TYPE_DOCK */
SLIST_HEAD(dock_clients_head, Client) dock_clients;
TAILQ_ENTRY(Screen) screens;
};

View File

@ -623,7 +623,7 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
if (client->dock) {
LOG("Removing from dock clients\n");
SLIST_REMOVE(&(client->workspace->dock_clients), client, Client, dock_clients);
SLIST_REMOVE(&(client->workspace->screen->dock_clients), client, Client, dock_clients);
}
LOG("child of 0x%08x.\n", client->frame);

View File

@ -389,7 +389,7 @@ void render_container(xcb_connection_t *conn, Container *container) {
static void render_bars(xcb_connection_t *conn, Workspace *r_ws, int width, int *height) {
Client *client;
SLIST_FOREACH(client, &(r_ws->dock_clients), dock_clients) {
SLIST_FOREACH(client, &(r_ws->screen->dock_clients), dock_clients) {
LOG("client is at %d, should be at %d\n", client->rect.y, *height);
if (client->force_reconfigure |
update_if_necessary(&(client->rect.x), 0) |
@ -510,7 +510,7 @@ void render_layout(xcb_connection_t *conn) {
/* Reserve space for dock clients */
Client *client;
SLIST_FOREACH(client, &(r_ws->dock_clients), dock_clients)
SLIST_FOREACH(client, &(screen->dock_clients), dock_clients)
height -= client->desired_height;
/* Space for the internal bar */

View File

@ -227,7 +227,7 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
new->titlebar_position = TITLEBAR_OFF;
new->force_reconfigure = true;
new->container = NULL;
SLIST_INSERT_HEAD(&(c_ws->dock_clients), new, dock_clients);
SLIST_INSERT_HEAD(&(c_ws->screen->dock_clients), new, dock_clients);
}
}

View File

@ -42,7 +42,6 @@ void init_table() {
for (int i = 0; i < 10; i++) {
workspaces[i].screen = NULL;
workspaces[i].num = i;
SLIST_INIT(&(workspaces[i].dock_clients));
expand_table_cols(&(workspaces[i]));
expand_table_rows(&(workspaces[i]));
}

View File

@ -182,6 +182,8 @@ static void initialize_screen(xcb_connection_t *conn, i3Screen *screen, Workspac
screen->bargc = xcb_generate_id(conn);
xcb_create_gc(conn, screen->bargc, screen->bar, 0, 0);
SLIST_INIT(&(screen->dock_clients));
/* Copy dimensions */
memcpy(&(workspace->rect), &(screen->rect), sizeof(Rect));
LOG("that is virtual screen at %d x %d with %d x %d\n",
@ -265,6 +267,9 @@ void xinerama_requery_screens(xcb_connection_t *conn) {
screen->bar = workspaces[c].screen->bar;
screen->bargc = workspaces[c].screen->bargc;
/* Copy the list head for the dock clients */
screen->dock_clients = workspaces[c].screen->dock_clients;
/* Update the dimensions */
memcpy(&(workspaces[c].rect), &(screen->rect), sizeof(Rect));
workspaces[c].screen = screen;