Bugfix: Store dock clients per screen, not per workspace.
This fixes ticket #12
This commit is contained in:
parent
8cc1fcf536
commit
bcbe800720
|
@ -143,9 +143,6 @@ struct Workspace {
|
||||||
|
|
||||||
Client *fullscreen_client;
|
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 stack contains the clients in the correct order of focus so that
|
||||||
the focus can be reverted correctly when a client is closed */
|
the focus can be reverted correctly when a client is closed */
|
||||||
SLIST_HEAD(focus_stack_head, Client) focus_stack;
|
SLIST_HEAD(focus_stack_head, Client) focus_stack;
|
||||||
|
@ -317,6 +314,9 @@ struct Screen {
|
||||||
xcb_window_t bar;
|
xcb_window_t bar;
|
||||||
xcb_gcontext_t bargc;
|
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;
|
TAILQ_ENTRY(Screen) screens;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -623,7 +623,7 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
|
||||||
|
|
||||||
if (client->dock) {
|
if (client->dock) {
|
||||||
LOG("Removing from dock clients\n");
|
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);
|
LOG("child of 0x%08x.\n", client->frame);
|
||||||
|
|
|
@ -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) {
|
static void render_bars(xcb_connection_t *conn, Workspace *r_ws, int width, int *height) {
|
||||||
Client *client;
|
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);
|
LOG("client is at %d, should be at %d\n", client->rect.y, *height);
|
||||||
if (client->force_reconfigure |
|
if (client->force_reconfigure |
|
||||||
update_if_necessary(&(client->rect.x), 0) |
|
update_if_necessary(&(client->rect.x), 0) |
|
||||||
|
@ -510,7 +510,7 @@ void render_layout(xcb_connection_t *conn) {
|
||||||
|
|
||||||
/* Reserve space for dock clients */
|
/* Reserve space for dock clients */
|
||||||
Client *client;
|
Client *client;
|
||||||
SLIST_FOREACH(client, &(r_ws->dock_clients), dock_clients)
|
SLIST_FOREACH(client, &(screen->dock_clients), dock_clients)
|
||||||
height -= client->desired_height;
|
height -= client->desired_height;
|
||||||
|
|
||||||
/* Space for the internal bar */
|
/* Space for the internal bar */
|
||||||
|
|
|
@ -227,7 +227,7 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
|
||||||
new->titlebar_position = TITLEBAR_OFF;
|
new->titlebar_position = TITLEBAR_OFF;
|
||||||
new->force_reconfigure = true;
|
new->force_reconfigure = true;
|
||||||
new->container = NULL;
|
new->container = NULL;
|
||||||
SLIST_INSERT_HEAD(&(c_ws->dock_clients), new, dock_clients);
|
SLIST_INSERT_HEAD(&(c_ws->screen->dock_clients), new, dock_clients);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ void init_table() {
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
workspaces[i].screen = NULL;
|
workspaces[i].screen = NULL;
|
||||||
workspaces[i].num = i;
|
workspaces[i].num = i;
|
||||||
SLIST_INIT(&(workspaces[i].dock_clients));
|
|
||||||
expand_table_cols(&(workspaces[i]));
|
expand_table_cols(&(workspaces[i]));
|
||||||
expand_table_rows(&(workspaces[i]));
|
expand_table_rows(&(workspaces[i]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,6 +182,8 @@ static void initialize_screen(xcb_connection_t *conn, i3Screen *screen, Workspac
|
||||||
screen->bargc = xcb_generate_id(conn);
|
screen->bargc = xcb_generate_id(conn);
|
||||||
xcb_create_gc(conn, screen->bargc, screen->bar, 0, 0);
|
xcb_create_gc(conn, screen->bargc, screen->bar, 0, 0);
|
||||||
|
|
||||||
|
SLIST_INIT(&(screen->dock_clients));
|
||||||
|
|
||||||
/* Copy dimensions */
|
/* Copy dimensions */
|
||||||
memcpy(&(workspace->rect), &(screen->rect), sizeof(Rect));
|
memcpy(&(workspace->rect), &(screen->rect), sizeof(Rect));
|
||||||
LOG("that is virtual screen at %d x %d with %d x %d\n",
|
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->bar = workspaces[c].screen->bar;
|
||||||
screen->bargc = workspaces[c].screen->bargc;
|
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 */
|
/* Update the dimensions */
|
||||||
memcpy(&(workspaces[c].rect), &(screen->rect), sizeof(Rect));
|
memcpy(&(workspaces[c].rect), &(screen->rect), sizeof(Rect));
|
||||||
workspaces[c].screen = screen;
|
workspaces[c].screen = screen;
|
||||||
|
|
Loading…
Reference in New Issue