]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: fix floating coordinates when moving assigned workspaces
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 4 Aug 2012 13:20:56 +0000 (15:20 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 4 Aug 2012 14:09:10 +0000 (16:09 +0200)
src/randr.c

index 73adbf0ea6042327508ff8b619a395fdbf7c66bb..00668c18c3b959edf5e625c45f5aa543efae16b7 100644 (file)
@@ -359,6 +359,19 @@ void init_ws_for_output(Output *output, Con *content) {
             workspace_show(previous);
         }
 
+        /* Render the output on which the workspace was to get correct Rects.
+         * Then, we need to work with the "content" container, since we cannot
+         * be sure that the workspace itself was rendered at all (in case it’s
+         * invisible, it won’t be rendered). */
+        render_con(workspace_out, false);
+        Con *ws_out_content = output_get_content(workspace_out);
+
+        Con *floating_con;
+        TAILQ_FOREACH(floating_con, &(workspace->floating_head), floating_windows)
+            /* NB: We use output->con here because content is not yet rendered,
+             * so it has a rect of {0, 0, 0, 0}. */
+            floating_fix_coordinates(floating_con, &(ws_out_content->rect), &(output->con->rect));
+
         con_detach(workspace);
         con_attach(workspace, content, false);