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

X11 clipboard incr proto #12357

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

Conversation

viordash
Copy link
Contributor

What does the pull request do?

improving the functionality of the X11 clipboard::

  • Implement the INCR protocol (process a large amount of data from other applications)
  • some minor fixes
  • refactoring the X11Clipboard code (OnEvent callback and WriteTargetToProperty)
  • code format the X11Clipboard code

What is the current behavior?

The INCR protocol is not implemented. (https://x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#id2588019)

What is the updated/expected behavior with this PR?

Ability to copy/paste data larger than 256 KB

How was the solution implemented (if it's not obvious)?

Sending/receiving data in chunks of 256 k bytes.
Using the XExtendedMaxRequestSize/XMaxRequestSize methods to get the fragment size supported by the system was unsuccessful because CLIPBOARD_MANAGER has a hard-coded value of 256 KB (Linux Ubuntu 18/22 and Mint 21.1 Mate)

Testing was performed via the Clipboard Page in samples/Control Catalog(together with the image from the clipboard PR #12246)

@avaloniaui-team
Copy link
Contributor

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

@kekekeks
Copy link
Member

kekekeks commented Jul 28, 2023

What would happen if two operations overlap? e. g. if avalonia app tries to paste twice in a row or if it receives data requests from 2 applications (one being a clipboard manager reacting to changed selection, another one initiated by the app the user alt-tabbed into).

It is quite possible for one of those to not be completed yet when the second one begins, since transferring 64mb of an 4K image can take a bit of time.

The initial plan for supporting INCR was to refactor the code in a way that would track each operation in an instance of a special class.

@viordash
Copy link
Contributor Author

The initial plan for supporting INCR was to refactor the code in a way that would track each operation in an instance of a special class.

do you want to make support for parallel work with the clipboard? Or is blocking enough at the time of writing/reading fragmented data

@kekekeks
Copy link
Member

Blocking won't really help since an unrelated event might arrive and we can't really ignore those

@viordash
Copy link
Contributor Author

viordash commented Jul 29, 2023

with the last 2 commits I added support for parallel operations INCR.

ps. without knowing the rules of the project code, new classes were created inside the X11 clipboard class

@avaloniaui-team
Copy link
Contributor

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

@avaloniaui-team
Copy link
Contributor

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

@avaloniaui-team
Copy link
Contributor

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

@kekekeks kekekeks self-assigned this Jul 30, 2023
@kekekeks kekekeks added this to the 11.1 milestone Aug 2, 2023
@maxkatz6 maxkatz6 modified the milestones: 11.1, 11.x Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants