Open jchv opened 1 month ago
That's odd because I do test under wayland, before every release.
Something fishy is going on if you end up in this code path. The keyboard bindings should only be loaded under X11: https://github.com/Xpra-org/xpra/blob/93141108c80c87232516c667ab4f446cbbc93490/xpra/platform/posix/keyboard.py#L28-L32 This should guard against calling xsync: https://github.com/Xpra-org/xpra/blob/93141108c80c87232516c667ab4f446cbbc93490/xpra/platform/posix/keyboard.py#L273-L275 But I guess that the import is more strict: https://github.com/Xpra-org/xpra/blob/93141108c80c87232516c667ab4f446cbbc93490/xpra/platform/posix/keyboard.py#L18-L19
And it is possible to have both is_Wayland
and is_X11
return True...
eb3057cc40c0ef10e0bdbf3d4e3802f843936031 should fix this.
Wow, thanks for looking at this immediately. I believe this should entirely prevent the problem.
I think what's actually going on here is I'm always getting XWayland under Xpra 6, and in spite of that is_Wayland
sometimes returns true anyways.
I actually want it to always load under XWayland but I'm guessing this signals another issue, probably in the NixOS package. If I try to force native Wayland, GTK still tries to load in X11 mode.
$ GDK_BACKEND=wayland DISPLAY= XPRA_NOX11=yes xpra attach ...
failed to initialize Gtk, no display?
(I did test that other Wayland apps are launching fine in the terminal.)
I can't really dig into it right now but I will try to take a look soon. I don't want to waste your time on what is possibly a downstream problem.
Describe the bug Running
xpra attach
on Xpra 6.1.2 fails with the following error:Normally I would test with the latest HEAD just to be sure, but looking at the code I don't believe it's possible that the bug has been fixed since 6.1.2 was released.
Downstream report: https://github.com/NixOS/nixpkgs/issues/347294
To Reproduce It's easy to reproduce this bug even without Wayland because the way Wayland is detected is imperfect. e.g. You should be able to trigger it by setting
GDK_BACKEND="wayland" WAYLAND_DISPLAY=""
or something similar.System Information (please complete the following information):
Additional context I normally use Xpra under XWayland, which makes more sense to me anyways given what it is doing. If I use
GDK_BACKEND=x11
then it works again, since the Wayland detection will then return false.The bug here seems to come down to the fact that although
xsync
is conditionally imported, it is still used unconditionally in some codepaths that are hit under Wayland. I'm not sure how this should be fixed. Maybe failing all else the commit that makes the import conditional should just be reverted for now.Thanks.