]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Store dock clients per screen, not per workspace.
authorMichael Stapelberg <michael+x200@stapelberg.de>
Sat, 11 Apr 2009 12:29:15 +0000 (14:29 +0200)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Sat, 11 Apr 2009 12:29:15 +0000 (14:29 +0200)
This fixes ticket #12

include/data.h
src/handlers.c
src/layout.c
src/mainx.c
src/table.c
src/xinerama.c

index 21ea722eaba89f471711666059983713f6fb27b8..87112ac29c186d0efe55c7e5be20cf113faa3999 100644 (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;
 };
 
index 19ceebd25b414704e0014f56d2223224a86e5796..88f7ec6508a49b90396baa51f8db11122acd392b 100644 (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);
index dcb48340d3c7cd760fd6763624e84f39b5c17fc6..23f47cfd656a0df9bf140717b33b528519ea726e 100644 (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 */
index 9f93888a7b543f89deaebe79810eaf92228528a5..c94121fe13f4250ea26afd3c17452f5f0ad4594b 100644 (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);
                         }
         }
 
index 222ebdcca089c1dc13f43dff288d2475c5d6f393..0bf7aa4972f363ebb7273d56b76ff9ce3105ebf3 100644 (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]));
         }
index 6b8d15ec2a2738f001e752d40a9b0909ae9ab4a6..4926dfbde40b91490aebdb7ad5196f37260eb7e7 100644 (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;