]> git.sur5r.net Git - i3/i3/blobdiff - src/layout.c
Bugfix: correctly translate coordinates for floating windows when outputs change
[i3/i3] / src / layout.c
index 202f5601d09fdf5da7233efddabf7c22a3f64c84..b13380403731f3a3ebdb4ce54e51eee9ba3bc85d 100644 (file)
@@ -225,6 +225,12 @@ void reposition_client(xcb_connection_t *conn, Client *client) {
                 return;
         }
 
+        if (output->current_workspace == NULL) {
+                DLOG("Boundary checking deferred, no current workspace on output\n");
+                client->force_reconfigure = true;
+                return;
+        }
+
         DLOG("Client is on workspace %p with output %p\n", client->workspace, client->workspace->output);
         DLOG("but output at %d, %d is %p\n", client->rect.x, client->rect.y, output);
         floating_assign_to_workspace(client, output->current_workspace);
@@ -737,6 +743,16 @@ void render_workspace(xcb_connection_t *conn, Output *output, Workspace *r_ws) {
                 yoffset[cols] += single_height;
         }
 
+        /* Reposition all floating clients with force_reconfigure == true */
+        TAILQ_FOREACH(client, &(r_ws->floating_clients), floating_clients) {
+                if (!client->force_reconfigure)
+                        continue;
+
+                client->force_reconfigure = false;
+                reposition_client(conn, client);
+                resize_client(conn, client);
+        }
+
         ignore_enter_notify_forall(conn, r_ws, false);
 
         render_bars(conn, r_ws, width, &height);