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

Text copied under xwayland can't be saved with cliphist #6247

Closed
hdm9527 opened this issue May 26, 2024 · 62 comments
Closed

Text copied under xwayland can't be saved with cliphist #6247

hdm9527 opened this issue May 26, 2024 · 62 comments
Labels
bug Something isn't working

Comments

@hdm9527
Copy link

hdm9527 commented May 26, 2024

System Info and Version

System/Version info
Hyprland, built from branch main at commit 553232a3e4c112c8511309e6b685cb614895e714  (hyprctl: Add Config Flag to `hyprctl systeminfo` (6160)).
Date: Sun May 26 04:46:07 2024
Tag: v0.40.0-137-g553232a3, commits: 4743

flags: (if any)


System Information:
System name: Linux
Node name: Arch
Release: 6.9.1-3-cachyos-echo-lto
Version: #1 SMP PREEMPT_DYNAMIC Thu, 23 May 2024 07:58:33 +0000


GPU information: 
64:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev c7) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Bug or Regression?

Bug

Description

cliphist works under wayland, it doesn't work in xwayland.

How to reproduce

  1. Install wl-clipboard, cliphist
  2. Execute the wl-paste --watch cliphist store command in the terminal
  3. Find an xwayland app to copy text
  4. Use cliphist list to view copied text

Crash reports, logs, images, videos

No response

@hdm9527 hdm9527 added the bug Something isn't working label May 26, 2024
@Agent00Ming
Copy link
Contributor

please elaborate. I can do so just fine...

image

@hdm9527
Copy link
Author

hdm9527 commented May 26, 2024

please elaborate. I can do so just fine...

Both chrome xwayland mode and idea can be reproduced.

cliphist.mp4

@Agent00Ming
Copy link
Contributor

Then please change the title accordingly, chrome has the option of native wayland but intelliJ is the one real issue. i.e. "(xwayland) intelliJ idea cannot interact with wayland clipboard" or something

@hdm9527
Copy link
Author

hdm9527 commented May 26, 2024

Then please change the title accordingly, chrome has the option of native wayland but intelliJ is the one real issue. i.e. "(xwayland) intelliJ idea cannot interact with wayland clipboard" or something

This is a bug, you can compile hyprland with this commit 4cdddcf.

Here's hyprland compiled with 4cdddcf, cliphist working under xwayalnd

cliphist.mp4

@Agent00Ming
Copy link
Contributor

Agent00Ming commented May 26, 2024

I am well aware of that, but that's in the past now. If you want the bug to get fixed in the future then maybe consider helping out by labeling it correctly and with updated information as development goes on.

Were you not aware of #6132 ?

@hdm9527
Copy link
Author

hdm9527 commented May 26, 2024

I am well aware of that, but that's in the past now. If you want the bug to get fixed in the future then maybe consider helping out by labeling it correctly and with updated information as development goes on.

Were you not aware of #6132 ?

I know, #6086 was merged yesterday. I haven't learned C++, but can I provide log and debug information.

@drnikos
Copy link

drnikos commented May 26, 2024

I also have the same problem, I can only use copy paste for between wayland windows or xwayland windows, but I cant do that between wayland-xwayland. Also cliphist only stores the things I copy from wayland apps

@niksingh710
Copy link

@hdm9527 ig it is somehow related to latest MR vax is working on.

btw which ui you used for cliphist share that.

@hdm9527
Copy link
Author

hdm9527 commented May 26, 2024

@hdm9527 ig it is somehow related to latest MR vax is working on.

btw which ui you used for cliphist share that.

This script

@CarloCattano
Copy link

I cant copy into any electron apps , discord , slack , telegram ....

@snvfrgh
Copy link

snvfrgh commented Jun 4, 2024

I also encounter the same problem.

@Tristan971
Copy link

Does this issue require more information from us affected users? (same symptoms, all xwayland applications affected)

@CarloCattano
Copy link

It's working with latest. No issue present at all

@Tristan971
Copy link

Care to precise if by « latest » you mean master or 0.41.0? Because the latter definitely is not fixed.

@hdm9527
Copy link
Author

hdm9527 commented Jun 12, 2024

Care to precise if by « latest » you mean master or 0.41.0? Because the latter definitely is not fixed.

main branch (master)

@CarloCattano
Copy link

I upgrade frequently from hyprland-git, don't know the version numbers from heart

@degobbis
Copy link

I have the same problems, see #6519, when I'm using the latest official package 0.41.1
No Problems with version 0.40.0.

@vaxerski
Copy link
Member

what's the easiest app to repro this with? chromium seems to be copying text just fine for me.

@Tristan971
Copy link

Copying from chrome to discord, kitty to intellij/jetbrains ides, …

@degobbis
Copy link

In my case, from KeePass to Firefox Developer-Edition or KeePass to Geany or KeePass to Alacritty

@vaxerski
Copy link
Member

vaxerski commented Jun 16, 2024

kitty (wl) to intellij (xwl) works fine on my end:

image
image

@degobbis
Copy link

THX for your reply, it's just not helpful to tell me that it works for you.
It doesn't work for me as described in my issue.

What can I say, some change in version 0.41.0 is causing this problem, and unfortunately I am not able to analyse it.
Tell me what you need to better isolate it, and please tell me how to get to it, so I'll do my best to help.

@hdm9527
Copy link
Author

hdm9527 commented Jun 16, 2024

kitty (wl) to intellij (xwl) works fine on my end:

image image

freerdp(xwl) does not work. From freerdp to kitty cannot be pasted.

@Tristan971
Copy link

kitty (wl) to intellij (xwl) works fine on my end:

(lol) is there a good way for us to provide you with debug log/info of it not working on our end? Presumably there’s an external factor at fault but I couldn’t figure it out

@degobbis
Copy link

By the way, for RDP I use Remmina with freerdb, I also have problems with copying between host and RDP. What I also notice here is that the keyboard layout is not adopted.

@degobbis
Copy link

Finally, I would like to confirm that after downgrading to version 0.40.0, with the same configuration, the clipboard and keyboard recognition also work again in Remmina RDP

@vaxerski
Copy link
Member

that we already know. read my comment #6247 (comment)

@degobbis
Copy link

that we already know. read my comment #6247 (comment)

All right, then I'll wait for further instructions for testing. In the meantime, I'm working with version 0.40.0.

@Tristan971
Copy link

post a hyprland log from hl launched with HYPRLAND_TRACE=1 HYPRLAND_LOG_WLR=1 Hyprland

@degobbis you can follow these instructions to help debugging the issue

@degobbis
Copy link

post a hyprland log from hl launched with HYPRLAND_TRACE=1 HYPRLAND_LOG_WLR=1 Hyprland

@degobbis you can follow these instructions to help debugging the issue

Done here #6247 (comment)

@vaxerski
Copy link
Member

please try now

@degobbis
Copy link

OK, now I have downloaded the master branch and compiled with cmake.
Here the Log:
hyprland.log

hyprctl systeminfo -c now returns this error: Couldn't read (5)%

@vaxerski
Copy link
Member

[TRACE] [xwm] Selection notify for 247 prop 246 target 243
[ERR] [xwm] can't set clipboard: no MIMEs
[TRACE] [xwm] Selection notify for 247 prop 246 target 243
[ERR] [xwm] can't set clipboard: no MIMEs

This is likely the root cause, but I can't repro this happening at all. What X app is trying to copy?

@degobbis
Copy link

Is KeePass over this Buttons
grafik

@vaxerski
Copy link
Member

thanks! repro'd and fixed. Try now.

@degobbis
Copy link

degobbis commented Jun 16, 2024

I can confirm that the error with copying from KeePass has been fixed.

Maybe it's just the self-compiled version, but hyprctl systeminfo -c still returns the error Couldn't read (5)%

Also hyprpm update must be executed again for the split-monitor-workspaces plugin to work with every new login.

And maybe you can also have a look at why the keyboard layout is not passed cleanly to the RDP connection via Remmina with the rdesktop plugin.

In Hyprland the keyboard layout is used correctly.
Here is the log file: hyprland.log

@vaxerski
Copy link
Member

really odd with the hyprctl thing. Never seen that happen.

For RDP keymaps, I'd open a new issue. This is to track clipboard issues, which if none remain, should be closed. @hdm9527

@degobbis
Copy link

really odd with the hyprctl thing. Never seen that happen.

For RDP keymaps, I'd open a new issue. This is to track clipboard issues, which if none remain, should be closed. @hdm9527

OK, tell me the issue ID when you have opened it.

@vaxerski
Copy link
Member

uhh, you're the one to experience it so you should open it, lol

@hdm9527
Copy link
Author

hdm9527 commented Jun 17, 2024

thanks! repro'd and fixed. Try now.

Some xwayland apps cannot be copied to cliphist, e.g. intellij.

@hdm9527
Copy link
Author

hdm9527 commented Jun 17, 2024

thanks! repro'd and fixed. Try now.

Some xwayland apps cannot be copied to cliphist, e.g. intellij.

❯ wl-paste -l
text/html;charset=UTF-16
text/html;charset=UTF-16BE
text/html;charset=UTF-16LE
text/html;charset=ISO-8859-1
text/html;charset=US-ASCII
text/html
text/rtf
text/plain;charset=utf-8
text/plain
STRING
text/plain;charset=UTF-16
text/plain;charset=UTF-8
text/plain;charset=UTF-16BE
text/plain;charset=UTF-16LE
text/plain;charset=ISO-8859-1
text/plain;charset=US-ASCII
text/plain
text/plain;charset=unicode
JAVA_DATAFLAVOR:application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
JAVA_DATAFLAVOR:application/x-java-serialized-object; class=com.intellij.openapi.editor.impl.EditorCopyPasteHelperImpl$CopyPasteOptionsTransferableData

@fiskhest
Copy link

fiskhest commented Jun 17, 2024

post a hyprland log from hl launched with HYPRLAND_TRACE=1 HYPRLAND_LOG_WLR=1 Hyprland

Strangely enough, I cannot reproduce if I launch hyprland as quoted from a tty.

However, when I launch hyprland through gdm, I see sporadic issues copying from slack - it works roughly 1/10 tries, but when it works, it is saved to cliphist but my primary selection buffer is empty so I have to invoke and copy it from cliphist to get it to stick to my primary buffer.

Edit: my mistake, I meant the clipboard selection buffer rather than the primary, thanks for clarifying @Nama

@Nama
Copy link

Nama commented Jun 18, 2024

Wayland and XWayland windows keep separate primary clipboards (middle mouse click to paste).

If I select the text in Firefox/kitty "uwu" I can paste "uwu" only in Wayland windows.
If I select the text in discord "owo" I can paste "owo" only in XWayland windows.
The clipboards don't even override each other. I still paste "uwu" in Wayland windows after selecting "owo" in Xwayland window.
On newest commit.
hypr2.log

This sounds relevant (but I have no idea):

[TRACE] [pointer] hw transformed hotspot for DP-3: [Vector2D: x: 3, y: 1]
[LOG] Searching for matching rules for kitty (title: ~)
[LOG] [WLDataDevice] CWLDataDeviceProtocol::onKeyboardFocus: cannot send selection to a client without a data_device
[LOG] Set keyboard focus to surface 1, with [Window 5826e12ad5e0: title: " - Discord"]
[LOG] Searching for matching rules for discord (title:  - Discord)
[LOG] Window rule workspace 1 -> class:^(discord)$ matched [Window 5826e12ad5e0: title: " - Discord"]
[LOG] [PrimarySelection] CPrimarySelectionProtocol::updateSelection: cannot send selection to a client without a data_device
[LOG] [XDGShell] xdg_surface 5826e12ba3a0 requests geometry 0x0 1232x1410
[LOG] cursorImage request: surface 1
[LOG] CWLSurface 5826df7a33e0 called init()
[LOG] Callback 5826deb395d0 -> 5826deb395c8, CPointerManager removed.

@vaxerski
Copy link
Member

Primary selection is not shared between wl and xwl, correct, I did not implement that. This issue is about the clipboard as far as I am aware.

@Nama
Copy link

Nama commented Jun 18, 2024

oh? came here from #6132
That also worked until 0.41.0 ._.

@Tristan971
Copy link

I can confirm that the issue is solved for me with the last few commits on master

@vaxerski
Copy link
Member

I'll close this then, for primary selection one can open a new issue (though I doubt I'll implement that myself, consider not using xwayland)

@Tristan971
Copy link

consider not using xwayland

you know how it is... but can't blame you for not wanting to deal with this shit either

@armenr
Copy link

armenr commented Sep 7, 2024

For anyone who lands here and wants a solution or some help (until it's fixed/implemented in hyprland):

https://gist.github.com/armenr/81b77587c1dda1d00d1c1c9541dcda94

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

No branches or pull requests