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
Add support for incremental transfer of selections #275
Comments
GLFW doesn't support incremental clipboard data transfer yet. |
Note to self: UTF8_STRING |
I've been looking into this myself but I haven't been able to complete the implementation of it. Hopefully some of the experience in trying to implement it might be of use to someone else trying to do the same. In a nutshell, here is what happens and what ICCCM expects us to do to handle this INCR atom: Below, when calling if (_glfwGetWindowPropertyX11(event.xselection.requestor,
event.xselection.property,
event.xselection.target,
(unsigned char**) &data))
_glfw.x11.clipboardString = strdup(data); And the reason is because we are requesting To solve this we need to follow the ICCCM recommendation "INCR Properties". But in a nutshell:
If you are interested, here is a half-done implementation gist of incremental selections that I wrote.
Hopefully this is to some use to somebody, I wasn't able to figure it out myself unfortunately. |
Thank you, that's an an excellent description! It's a little absurd what clients need to do to accomplish things that are a couple of function calls on other platforms. I started implementing INCR two days ago. I have reading working, as well as conversion from STRING / Latin-1, but had a brief moment of despair when I realized that INCR, MULTIPLE and STRING can combine for writing. Some restructuring is in order before that can be implemented cleanly. Pushed it just now to the |
I need to focus on pull request reviews for a while. I've kept a lot of fine code waiting for a shameful a amount of time. If anyone wants to continue working on this in the meantime, based on code above or not, please do. |
This allows glfwGetClipboardString to retrieve clipboard contents larger than (typically) 2^18 bytes. Related to #275.
You can repro this with clipboard app from tests folder, here's a junk file of 262146 bytes, copy all of it and paste into window, you'll get:
The text was updated successfully, but these errors were encountered: