-
Notifications
You must be signed in to change notification settings - Fork 598
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 selection getter objects #2639
Conversation
This prepares a new class for getting selection contents. No run-time behaviour changes yet. Signed-off-by: Uli Schlachter <[email protected]>
So far they do not do match. The selection and target are specified and a window is created for a transfer, but no transfer is actually started yet. Signed-off-by: Uli Schlachter <[email protected]>
This commit adds support for simple selection transfers. INCR support is still missing. The API is that a selection getter object emit the "data" signal when some data becomes available and "data_end" when all data was received. Signed-off-by: Uli Schlachter <[email protected]>
Incremental transfers are required to be supported. This commit adds that necessary support to awesomeWM. Signed-off-by: Uli Schlachter <[email protected]>
The list of supported formats of the selection is queried by requesting the target TARGETS. This target is a list of ATOMs and needs special handling which is what this commit adds. Signed-off-by: Uli Schlachter <[email protected]>
Signed-off-by: Uli Schlachter <[email protected]>
/me is busy right now, will check this weekend, but thanks for this, great work |
Codecov Report
@@ Coverage Diff @@
## master #2639 +/- ##
==========================================
+ Coverage 85.22% 85.34% +0.12%
==========================================
Files 515 519 +4
Lines 34849 35186 +337
==========================================
+ Hits 29701 30031 +330
- Misses 5148 5155 +7
|
Signed-off-by: Uli Schlachter <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Right, this will need some abstraction layer(s). The useful bits are all there, async and all. With some way to set the selection and swap the PRIMARY
, SECONDARY
and CLIPBOARD
buffers, it would be perfect (this is outside the scope of the pull request).
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Uli Schlachter <[email protected]>
Thanks for the changes |
@psychon |
Uhm... nope, not really. We can query the selection owner, but that only gives us a window. I just tried with GVim and this is all the information that you can get from the selection owner info:
(Yes, there really is not a single property) In theory, all of the things that are listed in ICCCM can be queried: https://tronche.com/gui/x/icccm/sec-2.html#s-2.6.2 For example, |
mb lua code could iterate through all the windows and match the id? |
IIRC this is just a special window only for the selection, isn't it? |
Yup. You could try matching for closest window ID, but that means that you end up with "just a random window" for |
btw, just very curious what is the usecase for that |
@actionless |
This fixes a large part of #492. Namely, this PR adds the "paste" part of "copy&paste". Also, this complements #2638 which is the PR that adds notifications for when some selection changes.
Simple usage example:
The "data" signal is emitted for each piece of data that is received. After everything was received, "data_end" is emitted.
Simple example showing how to get the list of supported targets (in this case the argument is a table with the list of supported targets; everything else is (currently) a string):
This has only received minimal testing so far...