Skip to content

Fixes wrong workspace for window after restarting. #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2021

Conversation

dalyIsaac
Copy link
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
Copy link
Contributor

@N1x0 N1x0 left a comment

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