This caused confusing behavior when "focus follows cursor" was enabled,
but "cursor follows focus" was not. `update_focus_state` only updates
the cursor position if `cursor_follows_focus` is set, so this wasn't
actually moving the pointer when expected.
I presume this was a mistake, and `cursor_follows_focus` was intended
here.
It doesn't seem like there's really a need to have `Err(_)` and `Ok(None)`.
`Err(_)` means the set exists for the output, but doesn't have the
appropriate workspace index. It's a bit odd that the set not even
existing becomes `Ok(None)`.
Instead, just return `Err(InvalidWorkspaceIndex)` in either case.
I hoped to split this up into multiple commits, but the api
changes to `shell/workspace.rs` were to invasive to feasibly do this.
Here is a rough list of changes:
- Fullscreen windows aren't mapped to other layers anymore
- This they need their own logic for:
- Sending frames
- Dmabuf Feedback
- Primary outputs
- On commit handlers
- cursor tests
- They get their own unmap/remap logic
- They get a new restore state similar to minimized windows
- Refactored the minimized window state to reuse as much as possible
here
- They need to be part of focus stacks, which means adjusting them
to a new type `FocusTarget` as they previously only handled
`CosmicMapped`.
- Various shell handlers (minimize, move, menu) now have dedicated
logic for fullscreen surfaces
- This was partially necessary due to relying on CosmicSurface now,
partially because they should've had their own logic from the
start. E.g. the context menu is now reflecting the fullscreen
state
- Fullscreen windows may be rendered behind other windows now, when they
loose focus.
- This needed changes to input handling / rendering
Similar to the change in https://github.com/pop-os/cosmic-comp/pull/780,
but also updates it to be a little clearer than just an uncommented `age
= 0` line.
Ideally we want some robust system to re-use the offscreen buffer (but
not allocate more buffers indefinitely if the client doesn't capture
with the same `wl_buffer`).