Merge branch 'fix-dock-reconfigure'

This commit is contained in:
Michael Stapelberg 2011-08-27 13:47:51 +02:00
commit 9e46f7bd8f
3 changed files with 30 additions and 41 deletions

View File

@ -230,16 +230,6 @@ struct xoutput {
/** x, y, width, height */ /** x, y, width, height */
Rect rect; 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; TAILQ_ENTRY(xoutput) outputs;
}; };

View File

@ -374,40 +374,20 @@ static int handle_configure_request(xcb_configure_request_event_t *event) {
tree_render(); tree_render();
} }
/* 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");
con->geometry.height = event->height;
tree_render();
}
}
fake_absolute_configure_notify(con); fake_absolute_configure_notify(con);
return 1; 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);
return 1;
}
fake_absolute_configure_notify(conn, client);
return 1;
#endif
} }
#if 0 #if 0

View 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}->{width}, $primary->rect->width, 'dock node as wide as the screen');
is($docknode->{rect}->{height}, 30, 'dock node has unchanged height'); 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; $window->destroy;
sleep 0.25; sleep 0.25;