cosmic-comp/src/wayland/protocols
Ian Douglas Scott 194d5c8967 protocols/screencopy: Make frame/session send stopped/fail on drop
Previously, `Frame` was stored in KMS frame udata, but in some cases the
udata was dropped without a capture happening, and `Frame` did not
implement `Drop`, so `fail` was never sent.

Instead, rename `DropableFrame` to `Frame` and `Frame` to `FrameRef`, so
we can have a single instance of `Frame`, that will send `fail` on drop.
This guarantees either `.success` or `.fail` are send, as long as its
not leaked.

This seems to fix https://github.com/pop-os/cosmic-comp/issues/1305.
xdg-desktop-portal-cosmic prints an error, buy retries (as it should for
an `Unknown` error; though maybe there should be a retry limit) and the
session continues working.

(Not sure if it should be sending `failed`, or queing it with the next
frame so it can send `success` to the client, but this works and is
desirable as a failsafe anyway.)

`Session` and `CursorSession` are similiarly updated.

`.fail()`, `.success()`, and `.stop()` now consume
`Frame`/`Session`/`CursorSession`. So to stop a session, it is now
necessary to call `.remove_session()`, but then simply dropping with
send `.stop()`.

Factoring out some `Request::Capture` handling into a `capture_frame`
function seems to clean up error handling and such a bit.
2025-05-19 16:53:46 -07:00
..
output_configuration output_configuration: Allow setting xwayland primary output 2025-04-14 18:15:28 +02:00
workspace Fix compiler warnings 2025-05-19 21:29:51 +02:00
a11y.rs wayland: Add support for cosmic-a11y version 2 2025-03-24 19:10:52 +01:00
atspi.rs Add cosmic_atspi_v1 protocol 2024-10-31 18:49:56 +01:00
drm.rs chore: Fix smithay version 2024-06-26 16:18:08 +02:00
image_capture_source.rs Replace screencopy with ext-image-copy-capture-v1 2025-04-01 18:22:42 +02:00
mod.rs Replace screencopy with ext-image-copy-capture-v1 2025-04-01 18:22:42 +02:00
output_power.rs Use WeakOutput instead of Option<WeakOutput> 2024-11-18 18:24:53 +01:00
overlap_notify.rs Migrate away from Rectangle::from_loc_and_size 2025-01-07 12:50:35 +01:00
screencopy.rs protocols/screencopy: Make frame/session send stopped/fail on drop 2025-05-19 16:53:46 -07:00
toplevel_info.rs protocol/workspace: Drop support for cosmic v1 protocol 2025-04-22 07:48:23 -07:00
toplevel_management.rs protocol/workspace: Drop support for cosmic v1 protocol 2025-04-22 07:48:23 -07:00