]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Fix fullscreen for floating clients, fix window name updates for floating...
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 26 May 2009 14:46:50 +0000 (16:46 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 26 May 2009 14:46:50 +0000 (16:46 +0200)
src/handlers.c
src/util.c

index 10dd16fba342caf7a3de30f6f1342462e287c688..bd8d0f9a0ebc1a164adb1b8911b2c810f5b39b4b 100644 (file)
@@ -635,7 +635,7 @@ int handle_windowname_change(void *data, xcb_connection_t *conn, uint8_t state,
         if (client->dock)
                 return 1;
 
-        if (client->container->mode == MODE_STACK)
+        if (client->container != NULL && client->container->mode == MODE_STACK)
                 render_container(conn, client->container);
         else decorate_window(conn, client, client->frame, client->titlegc, 0);
         xcb_flush(conn);
@@ -703,7 +703,7 @@ int handle_windowname_change_legacy(void *data, xcb_connection_t *conn, uint8_t
         if (client->dock)
                 return 1;
 
-        if (client->container->mode == MODE_STACK)
+        if (client->container != NULL && client->container->mode == MODE_STACK)
                 render_container(conn, client->container);
         else decorate_window(conn, client, client->frame, client->titlegc, 0);
         xcb_flush(conn);
index 44f25fb80ccaa016104673125014455bc0c6f939..5174c91c46c53be769ca0062e4c8f72c293b27e2 100644 (file)
@@ -447,10 +447,10 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode)
  *
  */
 void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
-        /* clients without a container (docks) cannot be focused */
-        assert(client->container != NULL);
+        /* dock clients cannot enter fullscreen mode */
+        assert(!client->dock);
 
-        Workspace *workspace = client->container->workspace;
+        Workspace *workspace = client->workspace;
 
         if (!client->fullscreen) {
                 if (workspace->fullscreen_client != NULL) {
@@ -461,10 +461,10 @@ void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
                 workspace->fullscreen_client = client;
                 LOG("Entering fullscreen mode...\n");
                 /* We just entered fullscreen mode, let’s configure the window */
-                 uint32_t mask = XCB_CONFIG_WINDOW_X |
-                                 XCB_CONFIG_WINDOW_Y |
-                                 XCB_CONFIG_WINDOW_WIDTH |
-                                 XCB_CONFIG_WINDOW_HEIGHT;
+                uint32_t mask = XCB_CONFIG_WINDOW_X |
+                                XCB_CONFIG_WINDOW_Y |
+                                XCB_CONFIG_WINDOW_WIDTH |
+                                XCB_CONFIG_WINDOW_HEIGHT;
                 uint32_t values[4] = {workspace->rect.x,
                                       workspace->rect.y,
                                       workspace->rect.width,
@@ -491,11 +491,20 @@ void toggle_fullscreen(xcb_connection_t *conn, Client *client) {
                 LOG("leaving fullscreen mode\n");
                 client->fullscreen = false;
                 workspace->fullscreen_client = NULL;
-                /* Because the coordinates of the window haven’t changed, it would not be
-                   re-configured if we don’t set the following flag */
-                client->force_reconfigure = true;
-                /* We left fullscreen mode, redraw the whole layout to ensure enternotify events are disabled */
-                render_layout(conn);
+                if (client->floating) {
+                        /* For floating clients it’s enough if we just reconfigure that window (in fact,
+                         * re-rendering the layout will not update the client.) */
+                        reposition_client(conn, client);
+                        resize_client(conn, client);
+                        /* redecorate_window flushes */
+                        redecorate_window(conn, client);
+                } else {
+                        /* Because the coordinates of the window haven’t changed, it would not be
+                           re-configured if we don’t set the following flag */
+                        client->force_reconfigure = true;
+                        /* We left fullscreen mode, redraw the whole layout to ensure enternotify events are disabled */
+                        render_layout(conn);
+                }
         }
 
         xcb_flush(conn);