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

Clipboard bugs #4409

Closed
iDmple opened this issue Oct 31, 2024 · 10 comments
Closed

Clipboard bugs #4409

iDmple opened this issue Oct 31, 2024 · 10 comments
Labels
bug Something isn't working clipboard invalid This doesn't seem right

Comments

@iDmple
Copy link
Contributor

iDmple commented Oct 31, 2024

Issue to track the server-side of Xpra-org/xpra-html5#326

  • when "clipboard direction is set to-server, Xpra-html5 internal copy paste does not work anymore" - which would be an xpra bug
  • the server sends clipboard data even when to-server is set - I believe this only happens for "greedy" clients (like MS Windows, MacOS and html5) - another xpra server bug
  • "when clipboard is enabled and clipboard direction is set to-server, Xpra-html5 internal copy paste does not work anymore" - another xpra server bug?

I'm running Xpra version 6.2.0-1 (.deb package) on Ubuntu 24.04 (k8s) and Xpra-html5 16.2 on Mac with Chrome Version 130.0.6723.59 (Official Build) (arm64).

@iDmple iDmple added the bug Something isn't working label Oct 31, 2024
@totaam
Copy link
Collaborator

totaam commented Nov 12, 2024

clipboard direction is set to-server, Xpra-html5 internal copy paste does not work anymore

Please provide more specific steps.
Running my server with --clipboard-direction=to-server, I can set the clipboard value in an xterm using:

$ echo foo | xclip -i -selection CLIPBOARD

And then read it from another xterm within the same session just fine:

$ xclip -o -selection CLIPBOARD
foo

I also tried with gedit, and again, no problems that I could see.

the server sends clipboard data even when to-server is set

Nope, I was wrong about this one.
I've just verified and with --clipboard-direction=to-server the clipboard data is not sent to the browser at all:

if self.owned or not self._can_send or xid == 0:
return

This check skips emitting clipboard tokens (_can_send is False for direction=to-server)
And this discards requests from clients:

xpra/xpra/clipboard/core.py

Lines 651 to 654 in 854231f

if not proxy._can_send:
log("request for %s but sending is disabled, sending 'none' back", name)
no_contents()
return

"when clipboard is enabled and clipboard direction is set to-server, Xpra-html5 internal copy paste does not work

How is this different from the first point?

@totaam
Copy link
Collaborator

totaam commented Nov 23, 2024

@iDmple what am I missing?

@iDmple
Copy link
Contributor Author

iDmple commented Nov 25, 2024

Let me come back to you with more details.

@iDmple
Copy link
Contributor Author

iDmple commented Nov 25, 2024

1. clipboard is on with direction to-server

clipboard=true
clipboard-direction=to-server

When using the settings above, it's possible to copy from the host (outside Xpra) to Xpra (expected), but not the other way around (expected). For example, I can copy the browser URL of Chrome to an app inside Xpra. However, I cannot copy something from an Xpra app and paste it to another Xpra app (unexpected), I believe this is a bug.

2. no clipboard

clipboard=false

When using the settings above, it's possible to copy between Xpra apps (I don't know if this is expected or not), but not from the host to Xpra and the other way around (expected).

I'd like to be able to use the settings of the first usecase cited above, with the possibility to copy within Xpra apps, which is now only possible with clipboard=false.

I hope this is more clear, otherwise I'll make a video of what I'm doing.

@totaam
Copy link
Collaborator

totaam commented Nov 25, 2024

However, I cannot copy something from an Xpra app and paste it to another Xpra app (unexpected), I believe this is a bug.

I have included explicit steps with command lines, proving otherwise.
Perhaps your applications are different. Perhaps it would work with xclip in an xterm. Have you tried my reproduction steps to try to identify the difference?

it's possible to copy between Xpra apps (I don't know if this is expected or not)

Not a bug.
This cannot be prevented at all. X11 serves as an IPC mechanism.

@iDmple
Copy link
Contributor Author

iDmple commented Nov 25, 2024

Ok so it's an issue with apps. With xclip + xterm it works, but copy paste within RStudio and wezterm do not work (as shown below for wezterm).
Screenshot 2024-11-25 at 16 13 45
I'm not sure how these apps are different?

@totaam
Copy link
Collaborator

totaam commented Nov 26, 2024

I'm not sure how these apps are different?

Likely they require a mime-type not exposed by the other app.
I have no idea what you tried to copy, but most apps should handle text/plain.

@totaam totaam closed this as completed Nov 26, 2024
@totaam totaam added the invalid This doesn't seem right label Nov 26, 2024
@iDmple
Copy link
Contributor Author

iDmple commented Nov 28, 2024

I just tried to copy text. I tried to copy between same apps: wezterm to wezterm and RStudio to Rstudio, not between them, though.

@iDmple
Copy link
Contributor Author

iDmple commented Dec 2, 2024

Also, @totaam, I'm willing it's a mime-type issue, but then, how come copy/paste works when clipboard=no?

@totaam
Copy link
Collaborator

totaam commented Dec 2, 2024

how come copy/paste works when clipboard=no?

I don't know.
My guess is that xpra is requesting a mimetype for the html5 client (likely text/plain) and then the app doesn't expose anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working clipboard invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants