From: Michael Stapelberg Date: Sat, 27 Aug 2011 11:47:10 +0000 (+0200) Subject: Bugfix: Re-implement reconfiguring height of dock windows (+test) (Thanks thomasba) X-Git-Tag: 4.0.2~12^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e97a7e34f7b57df236c7d69077467b65bbf12a7a;p=i3%2Fi3 Bugfix: Re-implement reconfiguring height of dock windows (+test) (Thanks thomasba) --- diff --git a/include/data.h b/include/data.h index 4dc379c2..5797b7d8 100644 --- a/include/data.h +++ b/include/data.h @@ -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; }; diff --git a/src/handlers.c b/src/handlers.c index 02c37283..6b79ed40 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -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 diff --git a/testcases/t/10-dock.t b/testcases/t/10-dock.t index d4da8245..3f0a5195 100644 --- a/testcases/t/10-dock.t +++ b/testcases/t/10-dock.t @@ -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;