hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.63k stars 440 forks source link

"Paste Mouse Selection with Keyboard" logistical problem #2630

Closed paul1149 closed 5 months ago

paul1149 commented 6 months ago

Update: I don't know what's going on, but today I can select-copy, then Ctrl-C copy, and the data enters the clipboard history. I've been struggling with this problem for weeks to no avail, now suddenly it works as I would want. I can't explain this.


Hi,

I enjoy copy-q every day, so a big thank you again!

I don't know whether this is a bug, a feature request, or a limitation of Linux.

I have Store clipboard and Paste mouse selection with keyboard enabled. This is excellent because it allows to quick-copy/paste without clogging up the clipboard history, and to paste without having to position the mouse pointer, which often can be a huge pain.

But the problem now is in storing things in the clipboard history. First I select with the mouse. It therefore becomes stored in Linux secondary clipboard. Then I hit Ctrl-c to copy it to the main clipboard, and nothing happens. It is not placed in the main clipboard history. I think this is because Linux sees it's already in the second clipboard, so doesn't actually copy it? There is a popup Copy confirmation when I select, but not when I hit Ctrl-c.

Now, if I paste using Ctrl-v before copying or selecting anything else, no problem. But otherwise the copy is lost.

Note, I do NOT have Store text selected using mouse enabled. I'm sure that would solve my problem, but it would also clog up the clipboard history. I will use that if I have to, but I'm trying to see if there's a better way to solve this problem.

I'm on copyq 7.1.0.1, on MX Linux 23 (debian 12) with the KDE desktop environment.

Thanks much.

Lonniebiz commented 5 months ago

I wish I knew how to fix this issue. I'm in the habit of keying ctrl-c twice due to so many failures from only doing it once. That first time usually gets the selected text into copyQ, but ctrl-v doesn't achieve a paste, unless I copy multiple times.

paul1149 commented 5 months ago

I've also found it inconsistent. I ended up turning it all off, and then back on. Currently I have "Store clipboard" and "Paste mouse selection with keyboard" enabled. And it's been working most of the time. Ctrl-v pasting of the mouse selection is the bomb.

hluk commented 5 months ago

First I select with the mouse. It therefore becomes stored in Linux secondary clipboard. Then I hit Ctrl-c to copy it to the main clipboard, and nothing happens. It is not placed in the main clipboard history. I think this is because Linux sees it's already in the second clipboard, so doesn't actually copy it?

Ah, yes, this is correct.

I see it is still problem for example in a terminal app (Kitty):

I think I can fix this: CopyQ can also check if it "owned" the previous clipboard content but not the new one.

paul1149 commented 5 months ago

That's great Lukas. I think you've very succinctly stated the problem.

Lonniebiz commented 5 months ago

I'm running version 6.4.0 on Debian 12. What version must I run to enjoy this fix?

I don't understand the intricacies of copying and pasting as well as you guys do (when it comes to the primary and secondary buffers you've mentioned).

I use a remote desktop program called Remmina a lot. Without CopyQ I can typically ctrl-c, copying either locally or remotely, and it ends up in both my local and remote clipboards.

With CopyQ, I will sometimes copy something, and see it in CopyQ as the latest entry, but it won't paste remotely until I go into CopyQ and hit the "Activate Items" icon (which I usually click multiple times for good measure because I think I recall it requiring multiple clicks at times). Or, I'll control+C multiple times locally in order to ensure that my copy is also in the remote machine I'm accessing with Remmina. If I only hit ctrl-c once, it will often not paste remotely.

I'm hoping this fix addresses this scenario also. Perhaps its the same problem, but I'm not qualified to be sure.

Or, maybe the reason behind this is security, and I just need a better understanding about when I need to copy more than once for security sake. Not sure.

hluk commented 5 months ago

I'm running version 6.4.0 on Debian 12. What version must I run to enjoy this fix?

It will be available in the next release.

You can install the development version from here: https://download.opensuse.org/repositories/home:/lukho:/copyq/Debian_12/