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

Xwayland clipboard issues with citrix virtual machine #7958

Open
Kommynct opened this issue Feb 6, 2024 · 0 comments
Open

Xwayland clipboard issues with citrix virtual machine #7958

Kommynct opened this issue Feb 6, 2024 · 0 comments
Labels
bug Not working as intended

Comments

@Kommynct
Copy link

Kommynct commented Feb 6, 2024

This has happened on all sway versions for years now, i'm currently on 1:1.8.1-5 from arch

I will submit a debug log tonight if that would be helpful, I believe this does happen even with the default configuration file, as I haven't added anything that might change this, but I'd need to double check if that's absolutely necessary

  • Description:
    Step 1. Copy something from citrix workspace (which is xwayland)
    step 2. attempt to paste to a wayland window

You'll notice, it often doesn't work, however, there are some caveats of interest here:

xclip -o when ran in a native alacritty window works perfectly, it outputs exactly what was copied every time

wl-paste outputs nothing

HOWEVER, this does not work within an xterm window, I do not know why

I thought that based on this behavior, I could fix the issue with the following hacky workaround:

bindsym --release Control+c exec swaymsg -t get_tree | jq ‘… | select(.type?) | select(.focused==true) | .shell’ | grep -Eq ‘xwayland’ && [xclip -o | wl-copy]

Unfortunately, xclip -o outputs something different to sway itself than it does if you run it in an alacritty window, I then tried the following:

bindsym --release Control+c exec swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .shell' | grep -Eq 'xwayland' && alacritty -e sh -c "xclip -o | wl-copy"

Unfortunately, and I really just can't figure out why, that doesn't work either

Right now, my hacky workaround is to paste to another xwayland window, re-copy what I tried to copy before, then paste to the xwayland window again, and then the clipboard works for wayland windows... which is a bit silly.

Any help would be appreciated.

EDIT: I have discovered something new about the intricacies of this, I decided to try running a VM with i3, thinking that if I have a vm running x.org as an intermediary between citrix and the xwayland clipboard, that might resolve it... what i've discovered is that citrix actually doesn't even write to the clipboard until focus is lost, and on wayland, citrix doesn't have a way of knowing that focus was lost due to the inherent secure nature of the protocol, and that's why i'm able to make it work by rapidly switching between citrix and zim, if I go to my i3 vm, copy something, and switch workspaces back and forth, it works 100% of the time, if I don't switch workspaces back and forth, nothing is copied to the clipboard

Jesus christ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

1 participant