Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Two DataOffer events when taking the clipboard #3296

Open
WhyNotHugo opened this issue Oct 23, 2021 · 0 comments
Open

Two DataOffer events when taking the clipboard #3296

WhyNotHugo opened this issue Oct 23, 2021 · 0 comments

Comments

@WhyNotHugo
Copy link

WhyNotHugo commented Oct 23, 2021

I'm writing a clipboard monitor using the wlr-data-control-unstable-v1 protocol.

Whenever I take a selection (e.g.: call zwlr_data_control_device_v1::set_selection) I immediately get TWO zwlr_data_control_device_v1::data_offer events.

It's odd to even get one (I didn't expect to be notified of my own selections), but the second one seems like a bug.

My code linked above is a bit messy still, but serves as a reproduction example. I hope my own logging doesn't get in the way (I was also learning along the way), but it can be reproduced by:

  1. For consistency, clear both selections before starting (copy something onto both on a client and close it).
  2. Run WAYLAND_DEBUG=1 cargo run. 86251b9a works to repro this.
  3. On another client, select some text (so that it's copied into the PRIMARY selection).
  4. clipmon will copy all data from the selection and take the selection itself.
  5. After taking the selection, we get two data_offer events:
[1031691.210] zwlr_data_control_device_v1@5.data_offer(new id zwlr_data_control_offer_v1@3142568880)
...
[1031691.917] zwlr_data_control_device_v1@5.data_offer(new id zwlr_data_control_offer_v1@3142577344)

They are also both for the primary selection:

[1031691.522] zwlr_data_control_device_v1@5.primary_selection(zwlr_data_control_offer_v1@4278190081)
...
[1031692.235] zwlr_data_control_device_v1@5.primary_selection(zwlr_data_control_offer_v1@4278190082)

wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3296

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant