Skip to content

input/seat: check only the last output workspace on focus#9140

Open
kupospelov wants to merge 1 commit into
swaywm:masterfrom
kupospelov:workspace
Open

input/seat: check only the last output workspace on focus#9140
kupospelov wants to merge 1 commit into
swaywm:masterfrom
kupospelov:workspace

Conversation

@kupospelov
Copy link
Copy Markdown
Contributor

seat_set_workspace_focus() contains two references to the "last workspace":

  • last_workspace is the last focused workspace on all outputs.
  • new_output_last_ws is the last focused workspace on the new workspace output.

They are the same when using a single output, but with multiple outputs they can diverge: last_workspace will be the focused workspace on the previous output, new_output_last_ws will be the previously focused workspace on the current output.

This confusion seems to have led to #9139 when last_workspace was used instead of new_output_last_ws.

However, we can safely drop last_workspace and use new_output_last_ws for everything that seat_set_workspace_focus() does:

This commit also renames new_output_last_ws to last_workspace to keep the name simple.

`seat_set_workspace_focus()` contains two references to the "last
workspace":
- `last_workspace` is the last focused workspace on all outputs.
- `new_output_last_ws` is the last focused workspace on the new
  workspace output.

They are the same when using a single output, but with multiple outputs
they can diverge: `last_workspace` will be the focused workspace on the
previous output, `new_output_last_ws` will be the previously focused
workspace on the current output.

This confusion seems to have led to swaywm#9139 when `last_workspace` was used
instead of `new_output_last_ws`.

However, we can safely drop `last_workspace` and use
`new_output_last_ws` for everything that `seat_set_workspace_focus()`
does:
- Calling `node_set_dirty()` on the new output.
- Calling `wlr_ext_workspace_handle_v1_set_active()` on the last
  workspace (this fixes swaywm#9139).
- Skip `workspace_consider_destroy()` on `last_workspace`, since the
  other output still has it focused.

This commit also renames `new_output_last_ws` to `last_workspace` to
keep the name simple.
@kupospelov
Copy link
Copy Markdown
Contributor Author

@WhyNotHugo @emersion PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

ext-workspace-v1: sway does not deactivate workspace when focusing a workspace assigned to another output

1 participant