]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Re-implement reconfiguring height of dock windows (+test) (Thanks thomasba)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 27 Aug 2011 11:47:10 +0000 (13:47 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 27 Aug 2011 11:47:10 +0000 (13:47 +0200)
include/data.h
src/handlers.c
testcases/t/10-dock.t

index 4dc379c2cd727452a6a8b0d7c936d9e0592ff60c..5797b7d80d1db633dcb52eb94c4272c9ea55a521 100644 (file)
@@ -230,16 +230,6 @@ struct xoutput {
     /** x, y, width, height */
     Rect rect;
 
-#if 0
-    /** The bar window */
-    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;
-#endif
-
     TAILQ_ENTRY(xoutput) outputs;
 };
 
index 02c37283bef4c90fc46c44dda88790a2e85e37c9..6b79ed401ad445b3f4693e679a2fa241daec2d65 100644 (file)
@@ -374,40 +374,20 @@ static int handle_configure_request(xcb_configure_request_event_t *event) {
         tree_render();
     }
 
-    fake_absolute_configure_notify(con);
-
-    return 1;
-#if 0
-        /* Dock clients can be reconfigured in their height */
-        if (client->dock) {
-                DLOG("Reconfiguring height of this dock client\n");
-
-                if (!(event->value_mask & XCB_CONFIG_WINDOW_HEIGHT)) {
-                        DLOG("Ignoring configure request, no height given\n");
-                        return 1;
-                }
-
-                client->desired_height = event->height;
-                render_workspace(conn, c_ws->output, c_ws);
-                xcb_flush(conn);
-
-                return 1;
-        }
-
-        if (client->fullscreen) {
-                DLOG("Client is in fullscreen mode\n");
-
-                Rect child_rect = client->container->workspace->rect;
-                child_rect.x = child_rect.y = 0;
-                fake_configure_notify(conn, child_rect, client->child);
+    /* Dock windows can be reconfigured in their height */
+    if (con->parent && con->parent->type == CT_DOCKAREA) {
+        DLOG("Dock window, only height reconfiguration allowed\n");
+        if (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
+            DLOG("Height given, changing\n");
 
-                return 1;
+            con->geometry.height = event->height;
+            tree_render();
         }
+    }
 
-        fake_absolute_configure_notify(conn, client);
+    fake_absolute_configure_notify(con);
 
-        return 1;
-#endif
+    return 1;
 }
 #if 0
 
index d4da82451560fcb843f09e36e08eb0ba9bbe661e..3f0a5195a70737f4956cf9f3a75f57618864f8bf 100644 (file)
@@ -61,6 +61,25 @@ is($docknode->{rect}->{y}, 0, 'dock node placed at y=0');
 is($docknode->{rect}->{width}, $primary->rect->width, 'dock node as wide as the screen');
 is($docknode->{rect}->{height}, 30, 'dock node has unchanged height');
 
+#####################################################################
+# check that re-configuring the height works
+#####################################################################
+
+$window->rect(X11::XCB::Rect->new(x => 0, y => 0, width => 50, height => 40));
+
+sleep 0.25;
+
+@docked = get_dock_clients('top');
+is(@docked, 1, 'one dock client found');
+
+# verify the position/size
+$docknode = $docked[0];
+
+is($docknode->{rect}->{x}, 0, 'dock node placed at x=0');
+is($docknode->{rect}->{y}, 0, 'dock node placed at y=0');
+is($docknode->{rect}->{width}, $primary->rect->width, 'dock node as wide as the screen');
+is($docknode->{rect}->{height}, 40, 'dock height changed');
+
 $window->destroy;
 
 sleep 0.25;