-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FR] Add X11 Clipboard support #1
Comments
Thanks for the issue! Clipboard support is definitely a feature needed, it shouldn't be a problem for me to implement it so ill try to get it done today! Also, error reporting is a little wacky right now so ill probably make it better too. |
Thanks for the quick response! That's great to hear. I'd be happy to help with testing and provide feedback once the implementation is ready. I can try different use cases and report any issues or edge cases I find. Please let me know when there's something ready for testing. |
Hello, the clipboard implementation should be working now. Its gated behind the "clipboard" feature and there should be an example of how to use it inside the examples folder. Currently it only supports UTF8_STRING but adding support for other types shouldn't be hard! Please let me know if there is anything missing! |
Thanks for the implementation! I've noticed some unexpected behavior while testing the clipboard feature: Observed behavior:
I've also added three unit tests in PR #2 to verify basic clipboard operations:
However, these tests are not passing as expected. Could you help take a look at what might be causing these issues? I can provide more details or add debug logging if needed. |
Thanks so much for the feedback and PR. The issue where you couldn't read the clipboard after running copy is most likely because you lose x11 selections after the selection owner exits, on my machine it works as long as the copy example is still running while the paste example is run. Short summary of x11 selection When it comes to your tests you made, ill try to debug them and get them working as soon as possible, (im at school right now so it might not be done before later today) Thanks for letting me know! |
Hello, Sorry for the inconveniences but the clipboard is finally in a semi-stable state, i had to refactor the concurrency model in yaxi so it took a little longer then i would have liked but it is done. feel free to submit PR's for more clipboard formats if you need them. |
Thank you for improving the clipboard, The implementation is working much better now. I plan to submit new PRs to enhance the clipboard support, including:
I'll create separate PRs for each enhancement to keep changes focused and manageable. Looking forward to contributing more to this project. |
I've submitted a new PR #7 that primarily focuses on type extensions. While implementing the planned features, I encountered several challenges that I'd like to discuss:
These questions are particularly important for ensuring robust clipboard handling, efficient event processing, and graceful process termination. I'd appreciate any insights or guidance on addressing these concerns. |
Thanks for your great PR, these features where much needed. Answers
impl Drop for Clipboard {
fn drop(&mut self) {
// SOME SORT OF A SAVE MECHANISM HERE
self.listener.kill();
}
} Ill most likely have to look a little more into the clipboard manager though!
Unrelated SidenoteAlso just as a kind of unrelated side note, the queue implementation has gotten a massive performance boost as i switched it to using Condvar when waiting for events instead of the old method which would simply busy loop until the queue wasnt empty. |
I've implemented saving to the clipboard manager once the clipboard structure is dropped and also cleaning up the selection structure when we lose the selection, there are a few notable things with my implementation:
i would like to hear your opinion on this and if you have any proposals for a better way to do this! |
Thank you for completing the Share with you some of my recent progress. I am currently working on refactoring the implementation of the The purpose of refactoring is not only to enhance support for different Please feel free to share your thoughts and suggestions on the part of my work that I am currently working on. |
Hi Thanks, After skimming through your code i found that i really like your refactored version of the clipboard implementation, i think its a great step forward to have more support for different clipboard data types. Since you are working on a refactored version ill keep away from updating the clipboard implementation until the refactor is done. |
Hi, I've now completed the clipboard refactoring we discussed earlier. This PR #8 implements the enhanced clipboard functionality with support for different X11 selections and data formats. Would love to get your thoughts on this implementation. Thank you! |
Hi, thank you so much for the PR, i had to fix some issues i had with the tests but got it to work after a while, but i do have some problems to discuss, notably the tests seem to use a unreasonable long time to complete, im not sure why this is but it would be great if you could figure it out, other than that i find your clipboard implementation to be very good and i am looking forward to expanding it! |
Thank you for the feedback! I'm glad you find the clipboard implementation useful. Regarding the long test execution time - I'll definitely look into this. Could you share:
This will help me investigate and optimize the test performance. I'm also happy to collaborate on expanding the clipboard functionality further! |
thanks for the quick response, after further investigation i found that its the |
The current implementation of I'll investigate further about the Also, I've left some comments about test cases in the PR discussion thread - would appreciate your thoughts on those when you have a chance. |
Hi, I've submitted a new PR #10 to fix the clear operation failing to empty the clipboard. I've also added support for reading and writing uri_list and image clipboard types, and improved read performance by using targets for preliminary checks. Additionally, I've improved the test cases based on our previous discussion at e603bd5#commitcomment-149818973 One issue I'm currently investigating is that data written to the clipboard is being lost for all types except text. I'll need some more time to look into this. Could you please review the changes and let me know if you have any suggestions for improvement? |
Hello! I'm interested in using Yaxi for my project and wondering about clipboard functionality.
Does Yaxi have plans to support X11 clipboard operations (like CLIPBOARD and PRIMARY selection)? This would include basic operations like:
If there's no immediate plan for this feature, I'd be willing to contribute to implementing it. Would you be open to accepting a PR for clipboard support?
Thanks for creating this promising X11 Rust library!
The text was updated successfully, but these errors were encountered: