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.)
If the surface under the pointer has changed, we should send an `enter`
event immediately, instead of waiting for the next motion event. This
seems to fix that, without producing unnecessary events.
Instead of `time: 0`, this and other synthesized events should probably
use `CLOCK_MONOTONIC`. It seems libinput does document that it uses
that.
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.
Using `lto = "thin"` seems to increase incremental build time when a file
is `touch`ed from about 3 seconds to almost 30.
I'm not sure if this helped with anything, but there are probably better
ways to improve `dev` performance than enabling LTO.
Previously, screenshots and screencopy panicked if no DRM render nodes
are present.
Instead, create a `GlowRenderer` using llvmpipe, if available. This
should work as a fallback until pixman is integrated.
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.
It would make sense to have a bound like
`for<'frame> R::Frame<'frame>: AsGlowFrame<'frame>`. But that appears to
not behave properly due to current limitations of the borrow checker:
https://blog.rust-lang.org/2022/10/28/gats-stabilization.html#implied-static-requirement-from-higher-ranked-trait-bounds
Instead, this makes `glow_frame` and `glow_frame_mut` associated
functions of the `AsGlowRenderer` trait. Then it is pretty
straightforward to make the `RenderElement` implementations generic
using that and `FromGlesError`.
It would make sense to make `Self::Error: FromGlessError` a requirement
of the `AsGlowRenderer` trait, but due to the lack of implied bounds
support, that produces a bunch of errors about missing bounds. If Rustc
improves that eventually, some bounds could be cleaned up a bit:
https://github.com/rust-lang/rust/issues/44491