The EI protocol is needed for the xdg-desktop-portal `RemoteDesktop`
portal to emulate input devices, as well as by the `InputCapture` portal
for Synergy-like uses (input-leap supports Wayland with this portal).
This exposes a relatively simple API for a compositor to create EI seats
and devices, mirroring the `Seat` API. It also provides an
`InputBackend`
that converts emulated input to Smithay input events.
Receiver contexts for the `InputCapture` portal are also a bit more
complicated to implement. Those involve capturing input once the cursor
crosses outside the display. That isn't implemented at all here yet.
We may want to change things in the future to accommodate receiver
contexts, etc. But this API is fairly minimal to use, so future breaking
changes shouldn't be too challenging for a compositor to adapt to.
This handles the protocol details around _NET_WM_SYNC_REQUEST, and
exposes API so the compositor can coordinate configure events and
frame/decoration resize with app repaints.
Additionally, we set _XWAYLAND_ALLOW_COMMITS to 0 on the X11 window
while a sync request is in flight, which instructs the XWayland server
to not commit to the underlying wl_surface. This avoids black bars
along the edge of the window when resizing.
See https://specifications.freedesktop.org/wm/1.5/ar01s06.html#id-1.7.3
and https://fishsoup.net/misc/wm-spec-synchronization.html for details.
(Note that this does not implement `_NET_WM_FRAME_DRAWN` or
`_NET_WM_FRAME_TIMINGS`; this only implements the core
`_NET_WM_SYNC_REQUEST`.)
`smithay` already requires Rust 1.85.0, the version that introduces the
2024 edition. Updating to the new edition allows us to use if let
chains, etc.
To keep things simple here, this allows `unsafe_op_in_unsafe_fn` for
now, which is a warning by default in the 2024 edition.
Removing `ref` in various places is simple enough. The more complicated
issue here is "precise capture lists" using `use<..>`. This needs to be
manually added in various places for the API to still work as it does.
We also annoyingly need to turn some impl-trait arguments to explicitly
named type parameters:
https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html#migrating-cases-involving-apit
Remove profiler glFlush() and most calls outside GlesFrame
Rename EnteredGpuTracepoint -> GpuSpan
Expose profiling methods on GlesFrame
Add GPU span to blit()
It exports a sync point so there's a flush we can piggyback off.
Gate GPU profiling behind new tracy_gpu_profiling feature flag
Add profiling scope to QueryPool::collect()
Implement deleting timestamp queries
Bump tracy-client
Handle missing timer query extension
Document methods
Add GlesFrame::with_gpu_span() instead of the error-prone manual API
Make ScopedGpuSpan use a shared borrow making it possible to nest them
The enter() in render texture actually had a mistake where early error
returns were possible without exit(), which would cause an assertion
failure.
Co-authored-by: Christian Meissl <meissl.christian@gmail.com>
This fixes excessive keymap events with `virtual-keyboard-unstable-v1`
clients like fcitx5.
This depends on `sha2`. Adding a new dependency for this is annoying,
but this is a fairly widely used crate. `blake3` could also work but is
less widely used. Perhaps a dependency couple be avoided if `SipHasher`
is good enough, but as I understand it's not really meant to guarantee
an absence of collisions (but may be good enough in practice here?).
I expect computing a hash won't impact performance much, compared to
clients having to process excessive `keymap` events
Enable the new `sync` feature to make `pixman::Image` `Send`/`Sync`.
The new `pixman` version also makes various methods take `&mut`, so this
updates things to use mutable references where needed. This changes some
`borrow()` calls to `borrow_mut()`, but looks like it shouldn't cause
double borrows.