]> git.sur5r.net Git - i3/i3/commitdiff
Implement reconfiguration of floating clients
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 21 Jun 2009 11:29:48 +0000 (13:29 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 21 Jun 2009 11:29:48 +0000 (13:29 +0200)
src/handlers.c

index 3a422171088771910cfda28ec1853429205ff874..129eca9522b0c169f1661ee67a4576e73cdb11e8 100644 (file)
@@ -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");