Skip to content
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

Fixed getting text from clipboard in Linux #17467

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DemonExposer
Copy link

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 calling X11Clipboard.OnEvent). The reason for this is that the generic event handling in Avalonia does not catch SelectionEvent. 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 and OnEvent is still used.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #4320

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053197-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Nov 10, 2024

  • All contributors have signed the CLA.

@DemonExposer
Copy link
Author

@cla-avalonia agree

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

Successfully merging this pull request may close these issues.

X11Clipboard.GetTextAsync() doesn't return. Waits indefinitely. Ubuntu 18.04.
3 participants