]> git.sur5r.net Git - i3/i3/commitdiff
workspace_move_to_output: Avoid operations when workspace already at destination 3658/head
authorOrestis Floros <orestisf1993@gmail.com>
Thu, 21 Mar 2019 22:55:30 +0000 (00:55 +0200)
committerOrestis Floros <orestisf1993@gmail.com>
Fri, 22 Mar 2019 08:47:49 +0000 (10:47 +0200)
Closes #3635.
Probably the bug can still happen when a tree_close_internal happens
inside a workspace_show but modifying the code to avoid them seems to
not be worth it.

src/workspace.c

index 0aeecb456455208f5fa1b74abd15de9060f11217..3cf7475424b9015d76fded271fdb06261de842b4 100644 (file)
@@ -969,6 +969,11 @@ void workspace_move_to_output(Con *ws, Output *output) {
     Con *content = output_get_content(output->con);
     DLOG("got output %p with content %p\n", output, content);
 
+    if (ws->parent == content) {
+        DLOG("Nothing to do, workspace already there\n");
+        return;
+    }
+
     Con *previously_visible_ws = TAILQ_FIRST(&(content->focus_head));
     if (previously_visible_ws) {
         DLOG("Previously visible workspace = %p / %s\n", previously_visible_ws, previously_visible_ws->name);