This meant that, for windows that were not fully opaque, there was no
way to capture their transparency. No way to put a window with
transparency on top of a background in OBS, for example.
`Output` in Smithay doesn't track if the output still exists, other than
based on whether or not it has strong references. Which doesn't seem to
be working correctly.
There may be leaked strong references to `Output`s somewhere, and maybe
Smithay should track if an output is still valid, generally when it is
exposed as a Wayland global
(https://github.com/Smithay/smithay/issues/1584). But a check like this
works for now.
Addresses https://github.com/pop-os/cosmic-comp/issues/985.
`from_raw_parts()` is only sound if the alignment is the same, so it
can't be used to covert to a `Vec<u8>` from a type with a greater
alignment.
This isn't hard to avoid, luckily.
It seems we allocate a new `GlesRenderbuffer` every time we screencopy
to an shm buffer.
We probably should use a more complicated approach to do proper damage
tracking without any unnecessary copies, and re-using the GPU buffer,
but as long as this allocates a buffer the age of that buffer should be
treated as `0`.
Fixes corruption in cosmic-workspaces when shm screencopy is used. (For
instance, when Cosmic is run with software rendering.)
Previously, alt-tab wouldn't actually focus a window if it was on
another output, since the active output/workspace was unchanged.
We need to move the cursor if we activate a window on another output.
Avoids a little duplication (matching two variants, instead of three
backends).
The behavior, including errors and panics, should be unchanged for now.
Performance should also not be impacted.
This should help for adding llvmpipe rendering without a device node on
the kms backend, or for adding a variant for pixman.
This fixes an issue with `cosmic-panel` where, when a workspace is moved
back to an output after a monitor is disconnected and reconnected, the
panel doesn't hide because `cosmic-panel` thinks no toplevel is open on
that monitor.
After some testing, it seems `output_enter` isn't being sent here. In
particular, the `output_leave` call happens before the client binds the
`wl_output`, so there is no `wl_output` to send in an event yet.
This is addressed by keeping track of a set of `wl_output`s that we have
sent the event to. So if an output is bound, `refresh` can add it to
this list and send the event.
This is not needed for workspaces (though it could be done similarly)
since the handle objects are created by server events. So no race should
occur as long as the workspaces global is bound before the toplevel info
one.
This is increasingly not just related to screencopy, so it's weird to
add there. I don't see any other module that fits, so add one called
"quirks" (like the Linux kernel uses for device-specific handling in
generic drives).
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.