This allows `cosmic-workspaces` to rely on cosmic-comp for rendering the
background, and just have transparency. This should be a more reliable
and performant way of doing things, at least for now.
Instead of adding another opaque bool argument, this defines an
`ElementFilter` enum, which makes calls more readable.
Window surfaces are still included in screencopy, as needed for the
workspace previews.
Fixes https://github.com/pop-os/cosmic-workspaces-epoch/issues/27.
We want this to apply to changes to workspace either through keybindings
or the cosmic-workspaces UI, so it adding a check here seems reasonable.
In principle it could be good to have some kind of privileged protocol
for setting things like this.
We may also want a configuration option to disable animations at some
point.
`(w_elements, p_elements)` tuples are used in a bunch of places. A
struct with named fields is generally an improvement just due to the
fact the order is non-obvious.
But we can also add methods. In particular,
`extend_from_workspace_elements` abstracts out some of the more
redundant code in `workspace_elements`.
It would be nice to avoid allocation everywhere, but iterators would
complicate lifetimes, run into issues with needing multiple mutable
borrows to things like the `Renderer`, and be awkward in certain
functions without generator syntax. In any case, cosmic-comp already
relies on allocating vectors here.
If this abstraction is commonly useful in compositors, perhaps it could
be moved to Smithay.
Don't just check maximized windows on every refresh, remapping them and
causing flickering, but introduce a proper recalculate method to be
called on layer-shell events / set_output event.
Also if we need to remap, remap all windows to keep stacking order.