-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixed getting text from clipboard in Linux #17467
base: master
Are you sure you want to change the base?
Conversation
You can test this PR using the following package version. |
|
@cla-avalonia agree |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
@kekekeks when is this going to get reviewed? |
I'm also having this clipboard issue on linux, hope to fix it, thank you very much! |
What does the pull request do?
It fixes issue #4320
What is the current behavior?
When calling X11Clipboard.GetTextAsync() in Linux (tested on Debian based), the task runs indefinitely (i.e. awaiting or
.Result
makes the current thread wait for an event to be handled, which does not happen)What is the updated/expected behavior with this PR?
It returns the text which is in the clipboard without issue.
How was the solution implemented (if it's not obvious)?
It was implemented by skipping all the generic event handling and just handling the event in
X11Clipboard
itself (by callingX11Clipboard.OnEvent
). The reason for this is that the generic event handling in Avalonia does not catchSelectionEvent
. I could not figure out why. I assume it's some X11 issue not properly working with GLib. Either way, it works with my changes andOnEvent
is still used.Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues
Fixes #4320