Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of refactoring the KMS code to allow for mirroring outputs (and generally not matching a single output per surface), I wanted to introduce proper per-thread rendering per surface.
This obviously leads to complications regarding access of the necessary window management code from various threads. This is an attempt of solving this mess, by moving the
Shell
behind anRwLock
. (The idea being that rendering and parts of the logic will only need to read the state and can do so in parallel, while modifications require an exclusive lock.)This has had a couple of consequences, one being, that the seats are now part of the state, which makes access inside the window management code easier. (And earlier attempt trying to introduce the lock without this ran into some ugly issues.)
Additionally all wayland event-loop related structs had to be moved out of the
Shell
, which is especially annoying for theWorkspaceState
and theXdgActivationState
, which are frequently needed (and now passed into) the window management code.One attempt at solving this (long-term) within wayland-rs and smithay is here: Smithay/smithay#1384
This would also allow to limit the access of grabs (or the
SeatHandler
in general) toShell
, which would mean we could move all theptr.set_grab
-code insideShell
and simply the logic quite a bit.Anyway this is good enough for now and seems to be working just the same as before. As per usual I will drive this a couple of days to make sure everything is sound, but given the large diff this shouldn't sit around for long.