]> git.sur5r.net Git - i3/i3/blobdiff - src/output.c
Prevent access of freed workspace in _workspace_show
[i3/i3] / src / output.c
index 1b232694ddc0b14ecbed72320305b8a26c567f7c..c76dfd035d213360ef727663b3e98ff49fba6db4 100644 (file)
@@ -49,7 +49,7 @@ Output *get_output_from_string(Output *current_output, const char *output_str) {
  *
  */
 char *output_primary_name(Output *output) {
-    return output->name;
+    return SLIST_FIRST(&output->names_head)->name;
 }
 
 Output *get_output_for_con(Con *con) {
@@ -99,7 +99,8 @@ void output_push_sticky_windows(Con *to_focus) {
                     continue;
 
                 if (con_is_sticky(current)) {
-                    con_move_to_workspace(current, visible_ws, true, false, current != to_focus->parent);
+                    bool ignore_focus = (to_focus == NULL) || (current != to_focus->parent);
+                    con_move_to_workspace(current, visible_ws, true, false, ignore_focus);
                 }
             }
         }