Skip to content

Fixes wrong workspace for window after restarting.#183

Merged
rickbutton merged 1 commit into
workspacer:masterfrom
dalyIsaac:stickyworkspaces-restart
Feb 19, 2021
Merged

Fixes wrong workspace for window after restarting.#183
rickbutton merged 1 commit into
workspacer:masterfrom
dalyIsaac:stickyworkspaces-restart

Conversation

@dalyIsaac

Copy link
Copy Markdown
Member

Reproduction:

Let there be 3 workspaces.

  • Open Notepad on the 2nd workspace.
  • Switch back to the first workspace.
  • Restart workspacer.

Expected behavior:

Notepad opens on the 2nd workspace.

Actual behavior:

Notepad opens on the 3rd workspace.

Diagnosis

This occurs because StickyWorkspaceContainer._workspaces is mutated in
StickyWorkspaceContainer.AssignWorkspaceToMonitor.

https://github.com/rickbutton/workspacer/blob/0aaff4437222e471ea0ffd282b948a9dfb8b7ff5/src/workspacer.Shared/Workspace/StickyWorkspaceContainer.cs#L112-L113

Reproduction:

- Let there be 3 workspaces.
- Open Notepad on the 2nd workspace.
- Switch back to the first workspace.
- Restart workspacer.

Expected behavior:

Notepad opens on the 2nd workspace.

Actual behavior:

Notepad opens on the 3rd workspace.

This occurs because `StickyWorkspaceContainer._workspaces` is mutated in
`StickyWorkspaceContainer.AssignWorkspaceToMonitor`.

https://github.com/rickbutton/workspacer/blob/0aaff4437222e471ea0ffd282b948a9dfb8b7ff5/src/workspacer.Shared/Workspace/StickyWorkspaceContainer.cs#L112-L113

@N1x0 N1x0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works just as intended from what I can tell. Very nice fix to a long-standing bug,
Thanks a lot!

@rickbutton rickbutton merged commit ca35476 into workspacer:master Feb 19, 2021
@dalyIsaac dalyIsaac deleted the stickyworkspaces-restart branch February 20, 2021 10:45
@dalyIsaac dalyIsaac added this to the 0.9.11 milestone Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants