winit/wayland: Subsurfaces for drag surfaces

Use `Icon::Surface` instead of `Icon::Buffer`, so we can then create
subsurfaces of the `wl_surface`.

Using `.screenshot()` then copying to an shm buffer is suboptimal, but
this does seem overall better than with the older Iced version when a
drag surface didn't appear until a Vulkan surface could be created for
it.

This re-uses `Connection` in the platform-specific code, instead of
creating from display handle on each call.
This commit is contained in:
Ian Douglas Scott 2024-12-17 15:13:24 -08:00 • committed by Ashley Wulber
parent 545ecb8a8a
commit fde0689def
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
6 changed files with 190 additions and 26 deletions

View file

@ -73,12 +73,14 @@ cctk.workspace = true
cctk.optional = true
wayland-protocols.workspace = true
wayland-protocols.optional = true
wayland-client.workspace = true
wayland-backend = { version = "0.3.1", features = [
"client_system",
], optional = true }
xkbcommon = { version = "0.7", features = ["wayland"], optional = true }
xkbcommon-dl = { version = "0.4.1", optional = true }
xkeysym = { version = "0.2.0", optional = true }
rustix = { version = "0.38" }
[target.'cfg(target_os = "windows")'.dependencies]
winapi.workspace = true