-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Copying to clipboard while xfreerdp is running but unfocused hangs Sway #6307
Comments
Are you using a clipboard manager? Please attach a full debug log, and your config file. |
I am not using a clipboard manager. Hey, I'm a stickler for process, but what good is 4.5GB of debug log going to do, or my config file? |
Alright, I managed now... reproduced the problem - apparently it happens every time. Only the behavior is not exactly the same every time. In this case I did not notice the machine freezing the way it often does, but when I checked the log file, I saw that the same output was pouring in as before. Here is the compressed logfile. It "only" has 220MB this time, uncompressed, but that still seemed rather large for pastebin. These are the steps I took this time:
|
Since I was on a roll with this <g>, I decided to check things out a bit more. I found that the issue seems to be specific to xfreerdp and its clipboard handling. I can work around this now I know what's going on - I'll leave it to others to decide whether the bug report still has merit or should be closed. |
Thanks for the details. As you've mentioned, this is an xfreerdp issue. It shouldn't be requesting clipboard contents when it's not focused. I wouldn't go so far as to say it's an xfreerdp bug since X11 does allow this, but Sway doesn't (and won't). Locally, you could probably work around this by removing this block of code: https://github.com/swaywm/wlroots/blob/master/xwayland/selection/outgoing.c#L413-L420 Some things worth checking:
|
I can confirm this "xfreerdp+firfox+copy" issue. |
Short update. I am not encountering this issue anymore now, and I believe it's because I started using wlfreerdp instead of xfreerdp. I had tried this previously, but wlfreerdp always exhibited strange behavior on Sway (grabbing keys so I couldn't switch workspaces anymore) - now I found that if I use Remmina as a frontend, I don't have these problems and I don't need to rely on Xwayland for xfreerdp. In case anybody is reading this thread on the search for a workaround, I hope this helps.
I have not tried this specifically, I killed the entire Xwayland session - which made Sway usable again. I'll try to find some time to conduct a special test and answer your questions. |
Is there any plans to fix this issue? The is really annoying thing with Xwayland hanging the sway while working. |
Patches welcome. |
Unfortunately I have no any coding skills, but I love linux, swaywm and my job has valuable amount of time of administrating windows servers via rdp. And I understand and totally appreciate your work. |
This isn't really on our end to fix. (Well, it's unfortunate that a misbehaving client can hang Sway, and maybe we should throttle them, but that's a larger issue than the one at hand.) We could allow unfocused Xwayland applications to read the Wayland clipboard, which would fix this. If this is blocking your work, you can do so locally just by deleting this code and recompiling. I don't have strong feelings on whether we should actually do this. Certainly someone else did when they wrote that check in the first place. Another alternative is to not notify the requestor that they're not going to receive clipboard contents and let them time out, by replacing this line with a Yet another alternative is to fix xfreerdp to not be so aggressive about retrying. It looks like if it sees a |
@Xyene |
Another alternative might be to present unfocused Xwayland applications an empty clipboard instead of denying the request or only allow access to (faked?) TARGETS and maybe TIMESTAMP, but deny everything else. |
Sway Version: 1.6-85291411 (Apr 23 2021, branch 'master')
Debug Log:
I had trouble before where Sway seemed to be non-responsive for a while - jerky mouse movement, slow reaction to keyboard, etc - and these problems seemed to occur most of the time when I had just copied something in Firefox. This time I was running Sway with -d and again I copied a URL in Firefox (running on Wayland). Suddenly the machine froze - worse than usual. After a while I managed to switch to a (VT) console and check the log file. By this time I had accumulated around 3.5GB of the same lines I pasted above - they repeated endlessly. I had just one Xwayland client running (xfreerdp) so I simply killed Xwayland and the problem went away immediately.
I should mention that xfreerdp was running on an invisible workspace when the problem occurred.
One additional note: it is possible that this issue is related to the specific formats Firefox adds for the clipboard content. I can't swear to it, but I think I have seen the problem almost exclusively when I copy from Firefox. I also use Vimium in Firefox, and I think the problem has never occurred when I use Vimium's "yank URL to clipboard" function instead of copying from the URL field in Firefox. I hope this information is useful to someone.
The text was updated successfully, but these errors were encountered: