From 8140619d5bfc5ce8324fe4e72c224b39cd7d39fc Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 21 Jun 2009 13:29:48 +0200 Subject: [PATCH] Implement reconfiguration of floating clients --- src/handlers.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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"); -- 2.39.5