Con *parent = workspace->parent;
con_detach(workspace);
con_attach(workspace, parent, false);
+ ipc_send_workspace_event("rename", workspace, NULL);
/* Move the workspace to the correct output if it has an assignment */
struct Workspace_Assignment *assignment = NULL;
cmd_output->needs_tree_render = true;
ysuccess(true);
- ipc_send_workspace_event("rename", workspace, NULL);
ewmh_update_desktop_names();
ewmh_update_desktop_viewport();
ewmh_update_current_desktop();
is(get_output_for_workspace('2'), 'fake-1',
'Renaming an unfocused workspace, triggering an assignment to the output which holds the currently focused empty workspace should result in the original workspace replacing the empty one');
+##########################################################################
+# Renaming an unfocused empty workspace, triggering an assignment to the
+# output which holds the currently focused non-empty workspace should
+# close the empty workspace and not crash i3.
+# See issue #3248.
+##########################################################################
+
+cmd 'workspace 1';
+cmd 'workspace 2';
+open_window;
+cmd 'rename workspace 1 to baz';
+is(get_output_for_workspace('baz'), '',
+ 'Renaming an unfocused empty workspace, triggering an assignment to the output which holds the currently focused non-empty workspace should close the empty workspace and not crash i3');
+kill_all_windows;
+
##########################################################################
# Renaming a workspace with multiple assignments, where the first output
# doesn't exist.