Skip to content

fix(Window Management): Next/Previous Desktop do not work#926

Merged
SteveLauC merged 1 commit intomainfrom
wm/next_workspace
Oct 14, 2025
Merged

fix(Window Management): Next/Previous Desktop do not work#926
SteveLauC merged 1 commit intomainfrom
wm/next_workspace

Conversation

@SteveLauC
Copy link
Copy Markdown
Member

This commit fixes the issue that when the current desktop contains more than 1 windows, moving the focused window via NextDesktop and PreviousDesktop won't work.

How? By adding 2 missing sleep() functions:

  1. https://github.com/ianyh/Silica/blob/b91a18dbb822e99ce6b487d1cb4841e863139b2a/Silica/Sources/SIWindow.m#L242
  2. https://github.com/ianyh/Silica/blob/b91a18dbb822e99ce6b487d1cb4841e863139b2a/Silica/Sources/SIWindow.m#L249

Also, this commit improves the implementation by resetting the mouse position. NextDesktop and PreviousDesktop are implemented by emulating mouse and keyboard events, draging the focused window and switching to the corresponding desktop. To make a window draggable, we have to move the mouse to the window's traffic light area. It is disturbing to not move the mouse back so this commit implements it.

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

This commit fixes the issue that when the current desktop contains more
than 1 windows, moving the focused window via `NextDesktop` and
`PreviousDesktop` won't work.

How? By adding 2 missing `sleep()` functions:

1. https://github.com/ianyh/Silica/blob/b91a18dbb822e99ce6b487d1cb4841e863139b2a/Silica/Sources/SIWindow.m#L242
2. https://github.com/ianyh/Silica/blob/b91a18dbb822e99ce6b487d1cb4841e863139b2a/Silica/Sources/SIWindow.m#L249

Also, this commit improves the implementation by resetting the mouse position.
`NextDesktop` and `PreviousDesktop` are implemented by emulating mouse and
keyboard events, draging the focused window and switching to the corresponding
desktop. To make a window draggable, we have to move the mouse to the window's
traffic light area. It is disturbing to not move the mouse back so this commit
implements it.
@SteveLauC SteveLauC merged commit ea34b7a into main Oct 14, 2025
4 checks passed
@SteveLauC SteveLauC deleted the wm/next_workspace branch October 14, 2025 09:39
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