-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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: Fix primary clipboard handling #96540
Wayland: Fix primary clipboard handling #96540
Conversation
pre-commit checks passed |
@fire Working on one more fix, this only fixes single line text boxes such as searching for a project |
3f6e8b6
to
e0ed82c
Compare
@fire fix for script editing merged, squashed There is also the possibility of wrapping the |
e0ed82c
to
ddf7fbe
Compare
ddf7fbe
to
739f284
Compare
Went ahead and pushed the other fix. Confirmed the function which returns an empty string from the clipboard primary is not working + only used in two places Wrapping it like this prevents if statements + code smell Unless changes are requested, this MR is done being edited by me |
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.
Hi, thank you for your contribution! The primary clipboard is different form the regular clipboard, so aliasing it to the regular one is not an acceptable solution unfortunately.
Instead, the proper fix would be to fix the primary clipboard logic itself.
Calling DisplayServer.clipboard_get_primary
from GDScript (with a random string in my primary clipboard) returns this in a verbose log:
Selecting media type "text/plain;charset=utf-8" from offered types.
Read chunk of 15 bytes.
Done reading 15 bytes.
So it's clearly trying to read something, although in the end it returns an empty string. The regular and the primary clipboard work in a very similar way, so perhaps there's some difference between their handling? I can see a flush instead of a roundtrip but it seems to make no difference once swapped in.
The part from the above log is printed from _read_fd
in platforms/linuxbsd/wayland/wayland_thread.cpp
, you could take a look there.
I hope this is a good starting point and thank you again for contributing!
thanks- will make a fix soon |
739f284
to
e46e96d
Compare
@Riteo PTAL- i am embarassed at how long it took to find this issue. We were throwing away the data gotten back from |
@hunterkepley lol no worries I did not notice that either! Thank you for your patience! |
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.
Looks perfect! One small nitpick, please rename the commit and title to match the new change, prefixing it with Wayland:
(e.g. Wayland: Fix primary clipboard handling
)
Will do 🙂 |
e46e96d
to
7949585
Compare
Thanks! And congrats for your first merged Godot contribution 🎉 |
Fixes #96214
Fixes issue with middle-mouse click (even if enabled) not working with Wayland. From the issue, it works when Wayland is not in use, same system settings. But, when Wayland is in use, it breaks