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

v11 - pasting does not work correctly for non-plain text #283

Closed
Rush-iam opened this issue Jan 31, 2024 · 6 comments
Closed

v11 - pasting does not work correctly for non-plain text #283

Rush-iam opened this issue Jan 31, 2024 · 6 comments

Comments

@Rush-iam
Copy link

Rush-iam commented Jan 31, 2024

When you copy text from a browser page into a buffer - it usually includes some kind of hidden formatting.

With v11 (I upgraded from v9.1), when you press Ctrl+V such text is pasted in an Xpra Client application with all formatting HTML tags.

E.g., I copy the word Assignees from the current issue page and paste it into any application in Xpra Client with Ctrl+V and get not the word Assignees but:

<span style="color: rgb(132, 141, 151); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, &quot;Noto Sans&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 600; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(13, 17, 23); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Assignees</span>
@totaam
Copy link
Collaborator

totaam commented Feb 1, 2024

Caused by #273

Unlike most real operating systems, we have no way of knowing what mimetype the application receiving the keyboard data actually wants.
I don't think that we can set both text/html and text/plain either - but it's worth a try.
The short term fix will be to add a configuration option on the connect page.

@totaam
Copy link
Collaborator

totaam commented May 14, 2024

We can set both text/html and text/plain by providing multiple ClipboardItems and the application can then choose what it wants to use.

This will only work for browsers that implement Clipboard.write, so this would work for chrome but not Firefox < 128 or Safari, see #301 (comment)
So we should probably still allow the html5 client to specify the preferred format - and default to text/plain?

This will require a server-side change too: Xpra-org/xpra#4228

@totaam
Copy link
Collaborator

totaam commented May 14, 2024

Now working again for text/plain which is the default again.
This can be changed using the advanced options:
image

@totaam totaam closed this as completed May 14, 2024
@heinosasshallik
Copy link

heinosasshallik commented May 16, 2024

@totaam I'm on the latest version of xpra and I don't see this option. I assume it hasn't been released yet?

I will have to set the format to text/plain by default. Could you please let me know how I can set this in xpra.conf?

@totaam
Copy link
Collaborator

totaam commented May 16, 2024

@heinosasshallik text/plain will be the new default.

@totaam
Copy link
Collaborator

totaam commented Jul 31, 2024

I had done it wrong: #316

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

3 participants