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

Weird cllipboard behavior #1889

Closed
L-U-T-i opened this issue Dec 23, 2024 · 9 comments
Closed

Weird cllipboard behavior #1889

L-U-T-i opened this issue Dec 23, 2024 · 9 comments

Comments

@L-U-T-i
Copy link

L-U-T-i commented Dec 23, 2024

Describe the bug
If the text is copied from a local machine and pasted to the first remote machine overwriting some other text, the clipboard content seem to change and - instead of locally copied text - the text which has just been overwritten on the first remote machine is pasted into the second remote machine after.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to 2 remote desktops, open pluma (mate desktop text editor; probably any other text editor should behave the same way...) in each of them, and write some text in the 1st remote desktop ('BBB' for instance)
  2. Open pluma on the local machine, write some text ('AAA' for instance) and copy it into the clipboard
  3. Select the already written text in pluma on the 1st remote machine ('BBB') and paste over it the clipboard content (text just copied from the local machine - 'AAA')
  4. Paste the clipboard content in pluma on the 2nd remote desktop; while 'AAA' is expected to be pasted there, 'BBB' actually appears...

Expected behavior
I would expect the same text just copied from from the local machine will be pasted on the 1st and on the 2nd remote desktop, as nothing has to be copied in between (paste over some other text should not copy the existing text being overwritten into the clipboard).

Screenshots
I guess it is clear enough without...

Client (please complete the following information):

  • OS: Rocky Linux 9.5
  • VNC client: TigerVNC
  • VNC client version: 1.14.80, latest git commit 6d5026f
  • Client downloaded from: github, custom rpmbuild based on spec file provided

Server (please complete the following information):

  • OS: Rocky Linux 9.5
  • VNC server: TigerVNC
  • VNC server version: 1.14.80, latest git commit 6d5026f
  • Server downloaded from: github, custom rpmbuild based on spec file provided
  • Server was started using: systemd

Additional context
A very similar bug has been present in the past (just the selected text on the remote machine to be overwritten has been pasted instead of text copied into the clipboard on the local machine, if I remember well). This seem to be a kind of reincarnation of that one...

@samhed
Copy link
Member

samhed commented Dec 27, 2024

This is as expected. I suspect you can reproduce a behavior you're not going to like without using two different viewers/remotes:

  1. Connect to a remote desktop, open pluma and write some text in it ('BBB' for instance)
  2. Open pluma on the local machine, write some text ('AAA' for instance) and copy it into the clipboard
  3. Select the already written text in pluma on the remote machine ('BBB') and paste over it the clipboard content (text just copied from the local machine - 'AAA')
  4. Paste the clipboard content on the local machine in pluma; while 'BBB' is expected to be pasted there, 'AAA' actually appears.

When selecting text, that text is actually copied to the selection clipboard, which is commonly pasted using middle-mouse. Linux has two different clipboards, and VNC combines them into one.

@samhed samhed closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2024
@L-U-T-i
Copy link
Author

L-U-T-i commented Jan 1, 2025

@samhed, I'd ask you to reopen this issue. It is actually NOT as you'we written! If I do what you suggest, 'BBB' would be pasted in stage 4 (that's what I am complaining about - please read my issue above carefully again... ;-)).

And no, I wouldn't nor expect that (as 'BBB' has not been copied in stage 3, just selected and written over; 'AAA' should remain in clipboard at this stage!) nor I like it. Why would anyone expect that at all?! I find it very annoying in fact. As I copy something into the clipboard and would like to paste it to 4 remote machines (one after another), but the clipboard is actually overwritten again and again with the content on remote machines just being selected (to paste over) and NOT copied!

It is a weird and in some cases very annoying behavior in contrary as anyone would expect (no matter how many clipboards a system has - if something is just selected and not copied, it should not spoil any of the clipboard contents, or?).

@MBD62
Copy link

MBD62 commented Jan 8, 2025

@L-U-T-i

if something is just selected and not copied, it should not spoil any of the clipboard contents, or?).

Depending on the used Desktop-software and its setup, selecting text will cause copying. This is how Linux would normally work, intentionally. (it may be possible to turn that behavior off, but why would one want to do so?? ;-) Am I misunderstanding the issue here?

@samhed
Copy link
Member

samhed commented Jan 8, 2025

@L-U-T-i I did not misread your text. And I re-tested the steps I outlined, things do behave like I wrote.

@L-U-T-i
Copy link
Author

L-U-T-i commented Jan 8, 2025

@MBD62

Depending on the used Desktop-software and its setup, selecting text will cause copying. This is how Linux would normally work, intentionally.

May I ask you to explain me this. If I copy some text (say "Text No.1") in one Pluma window to clipboard (select it, right click on it and click to "Copy"), and after that I just select some other text (say "Text No.2") in another Pluma window (or Firefox or whatever you want...), but I don't copy that one to a clipboard, according to you, "Text No.2" will be pasted to some other Pluma window (or, wherever else you want...)?! I've never ever heard something like that, nor experienced it (in my about 35+ years of experience with Winblow$ and linux)!

How would it be possible to paste some text over another text if things would work as you claim?! I use such feature many times - to replace just a substring, for instance. And, it always work as expected - to paste the previously selected and copied text over. According to you, nothing would be replaced (as the same text - just selected to be replaced - would just be pasted over itself...

@L-U-T-i
Copy link
Author

L-U-T-i commented Jan 8, 2025

@samhed

it seems you did, unfortunately. Or, misunderstand it.

The steps you've outlined are exactly the same thing I would expect, but not exactly what I am complaining about!

What you write happens with just 1 single remote machine. And, it is as expected (it has been an issue some years ago as well, but has been resolved then).

But, if you try to paste the same text ('AAA', copied from a local machine) to 2 different remote machines (where the first one has some text already selected, say "BBB"), "AAA" overwrites "BBB" (as you say, and as expected), but after that "BBB" is pasted on a second machine (despite the fact that "BBB" has never been copied to a clipboard, just selected to be pasted over on the 1st remote machine...). This is my issue (since the beginning).

I hope you agree that this is not an expected behavior.

@MBD62
Copy link

MBD62 commented Jan 9, 2025

May I ask you to explain me this. If I copy some text (say "Text No.1") in one Pluma window to clipboard (select it, right click on it and click to "Copy"), and after that I just select some other text (say "Text No.2") in another Pluma window (or Firefox or whatever you want...), but I don't copy that one to a clipboard, according to you, "Text No.2" will be pasted to some other Pluma window (or, wherever else you want...)?! I've never ever heard something like that, nor experienced it (in my about 35+ years of experience with Winblow$ and linux)!

Hm, my experience is different. Ever since the Unix days, I would have expected the action of selecting text to also place that in the clipboard, ready to be pasted with M2/middle-mouse. If that does not happen, my take on it would be that it is a software-specific behavior, or the thing is broken. (yes, I'm fully ignorant regarding Pluma) The last text selected is what is in the clipboard. (which seems contrary to your comment: " I just select some other text (say "Text No.2") in another Pluma window (or Firefox or whatever you want...), but I don't copy that one to a clipboard, according to you, "Text No.2" will be pasted to some other Pluma window (or, wherever else you want...)?!".
My expectation here would be that "Text No.2" is in the clipboard, if it was last selected on that computer. In other words, I don't know how to not copy selected text in Unix/Linux)

Loving that behavior of easy and fast text-replication, I used to use a utility called TX-Mouse successfully in WinXP, almost as successfully in Win7 but never really invested the time to see if I can also use it in Win10/Win11, although I should;-).

@bphinz
Copy link
Member

bphinz commented Jan 9, 2025 via email

@L-U-T-i
Copy link
Author

L-U-T-i commented Jan 9, 2025

@MBD62,

I am not talking about middle mouse button at all.

If you are not familiar with Pluma, take Gnome Text editor with 3 open files / windows or 3 Terminal windows, write "Text 1" and "Text 2" in two of them. Select "Text 1", right click on it and select "Copy". Select "Text 2" in 2nd window after, RIGHT click on it and select "Paste".

According to you, "Text 2" should be pasted over itself (as the last text selected and somehow "automatically" copied), but I've never ever experienced that (in any linux / windows). "Text 1" is pasted over, and if I go to the 3rd window and right click & paste there, "Text 1" is pasted as well. As I would expect it and as it sounds the only reasonable consequence of the actions taken. Not speaking about VNC at all, only local desktop with 3 windows (can also be mixed - text editor and terminal window or Firefox or Gimp or whatever else you like).

And no, I couldn't find (haven't even looked for it, to be honest) any option to tweak any clipboard behavior / actions, not in the application level nor in the system level. I've always used the default (and always got "right click" - or through a menu - pasted the last explicitely copied text). Since Fedora 6 (or whatever it has been at that time) and Centos 3 or 4, as well as in Window since 3.11 or Workgroups or whatever has been first...

Thanks God @bphinz explained to both of us what is one and what is the other talking about. But I take the Clipboard actions as normal, and the Primary selection (I haven't ever used it and never even mised it by now) as a specific use (I believe left and right click are more common use than the middle one...). And, I've never ever talked about any middle mouse click or something like that (so, no Primary selection, just a pure Clipboard actions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants