More of a clarification than necessarily a bug, or maybe requiring an enhancement.
When a window is moved to a workspace via move-window-to-workspace the focus options is defined as:
If
true(the default) and the window to move is focused, the focus will follow the window to the new workspace. Iffalse, the focus will remain on the original workspace.
So:
| Window_id has focus | focus option | active_window_id of target workspace | result |
|---|---|---|---|
| true | true | window_id | focus follows window to new workspace |
| true | false | unchanged | focus previous window within current workspace |
| false | true | unchanged | focus previous window within current workspace |
| false | false | unchanged | focus previous window within current workspace |
Should the target workspaces active_window_id be set to the moved window under certain criteria? maintaining the windows list focus_timestamp order.
Maybe:
| Window_id has focus | focus option | active_window_id of target workspace | result |
|---|---|---|---|
| true | true | window_id | focus follows window to new workspace |
| true | false | window_id | focus previous window within current workspace |
| false | true | window_id | focus previous window within current workspace |
| false | false | unchanged | focus previous window within current workspace |
Currently the work around would be a spawn-sh with:
- focus on the window to be moved
- move window to workspace with focus=true
- focus previous workspace
I can kinda see both sides, focus can be a bit ambiguous, but a bit biased due to my use case.
Like many I use a stash workspace, mostly pulling back the last window I've stashed, which tends not to be the one that has focus when I go to the stash workspace. Unless using a work around which is a bit choppy with screen refreshes.
Activity
2It's not a big deal. Just thought I'd make a suggestion that might solve my edge case, make some logical sense and possibly be relatively simple to implement. Loving Niri
I know it's not entirely consistent rn, this is due to the fact that the code doesn't have a good way to do finer grained focus management. It would need a bit of design and refactoring, and I haven't done it yet because it's not a big problem