-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wayland: Only set selection when there is not already a source. #99372
Wayland: Only set selection when there is not already a source. #99372
Conversation
Thank you for the PR! Sorry for not looking into this before, I somehow missed that issue 😅 Nothing in the spec seems to explicitly report this and I don't think I've ever noticed this behavior in sway, so I think that it might be some ambiguity in how the protocol's described. My theory is that my executing I think that the proper solution might be to avoid calling it if we already have a valid source, since it will be destroyed if something else replaces it. |
4050131
to
a46f111
Compare
Co-authored-by: Riteo Siuga <riteo@posteo.net>
a46f111
to
0d9a705
Compare
Always forget to run format when doing small edits....one day I'll remember. |
BTW, we have pre-commit support now, which should do this automatically for each commit ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found no regressions on sway!
Thanks! |
Might fix #95649.
While trying to use the editor I got really frustrated with inconsistent clipboard behavior when using wayland. Often, when text has been selected and then copied, the paste afterwards results in nothing. Trying to copy again usually succeeds.
The best way I have found to reproduce is to copy/paste once, scroll with mouse wheel, try copy/paste again.
When the source selection was reused, wayland seems to send a cancel event for the old(see
_wl_data_source_on_cancelled
), which causes us to destroy the source (which obviously means we didn't send anything to the clipboard now). Since the selection is now cleared, the second attempt works.Setting the selection only when there is not already a source seems to work.