Skip to content

Commit

Permalink
create_workspace_on_output: send workspace init event
Browse files Browse the repository at this point in the history
Fixes i3#3595
Like the issue mentions:
> instead of the newly created workspace (not referenced by variable
> here) the `"init"` event is fired with the current workspace (`ws`).

Plus, there was another issue where duplicate workspace init events
where being sent because of workspace_get().

Fixes i3#3631
No event was being sent here:
https://github.com/i3/i3/blob/2d6e09a66ad9b3e01588c515ae66476de8903754/src/randr.c#L487
  • Loading branch information
orestisfl committed Feb 22, 2019
1 parent 2d6e09a commit eddc157
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/workspace.c
Expand Up @@ -289,6 +289,7 @@ Con *create_workspace_on_output(Output *output, Con *content) {
ws->workspace_layout = config.default_layout;
_workspace_apply_default_orientation(ws);

ipc_send_workspace_event("init", ws, NULL);
return ws;
}

Expand Down Expand Up @@ -1004,13 +1005,11 @@ bool workspace_move_to_output(Con *ws, Output *output) {
break;
}

/* if we couldn't create the workspace using an assignment, create
* it on the output */
/* if we couldn't create the workspace using an assignment, create it on
* the output. Workspace init IPC events are sent either by
* workspace_get or create_workspace_on_output. */
if (!used_assignment)
create_workspace_on_output(current_output, ws->parent);

/* notify the IPC listeners */
ipc_send_workspace_event("init", ws, NULL);
}
DLOG("Detaching\n");

Expand Down

0 comments on commit eddc157

Please sign in to comment.