From: Michael Stapelberg Date: Sun, 21 Jun 2009 11:29:48 +0000 (+0200) Subject: Implement reconfiguration of floating clients X-Git-Tag: 3.b~34 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8140619d5bfc5ce8324fe4e72c224b39cd7d39fc;p=i3%2Fi3 Implement reconfiguration of floating clients --- diff --git a/src/handlers.c b/src/handlers.c index 3a422171..129eca95 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -476,6 +476,30 @@ int handle_configure_request(void *prophs, xcb_connection_t *conn, xcb_configure return 1; } + /* Floating clients can be reconfigured */ + if (client->floating >= FLOATING_AUTO_ON) { + i3Font *font = load_font(conn, config.font); + + if (event->value_mask & XCB_CONFIG_WINDOW_X) + client->rect.x = event->x; + if (event->value_mask & XCB_CONFIG_WINDOW_Y) + client->rect.y = event->y; + if (event->value_mask & XCB_CONFIG_WINDOW_WIDTH) + client->rect.width = event->width + 2 + 2; + if (event->value_mask & XCB_CONFIG_WINDOW_HEIGHT) + client->rect.height = event->height + (font->height + 2 + 2) + 2; + + LOG("Accepted new position/size for floating client: (%d, %d) size %d x %d\n", + client->rect.x, client->rect.y, client->rect.width, client->rect.height); + + /* Push the new position/size to X11 */ + reposition_client(conn, client); + resize_client(conn, client); + xcb_flush(conn); + + return 1; + } + if (client->fullscreen) { LOG("Client is in fullscreen mode\n");