Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.5k stars 143 forks source link

VirtualBox context menus disappear #4246

Open callegar opened 1 month ago

callegar commented 1 month ago

Describe the bug

Trying to use VirtualBox under xpra. Encountering an issue even before launching the virtual machines. In the main VirtualBox Window, pressing the right mouse button should open a contex menu. Under xpra this context menu cannot be used: it opens and closes automatically before you can even move the mouse on it.

To Reproduce Steps to reproduce the behavior:

  1. Start xpra on the server with xpra start :101 and then get a terminal on it (e.g. DISPLAY=:101 konsole)
  2. Attach to the client xpra attach ssh://server/101
  3. In the terminal from the server start VirtualBox
  4. In the VirtualBox window go to an entry corresponding to a virtual machine, press the right mouse button to get the context menu

See the context menu appearing and disappearing before you can use it.

System Information (please complete the following information):

Additional context

Both client and server use KDE plasma 6 with a wayland session.

totaam commented 1 month ago

Works fine on Fedora with Gnome - could be some incompatibility with KDE.

totaam commented 1 month ago

.. and then get a terminal on it (e.g. DISPLAY=:101 konsole)

Don't do that. Use --start=konsole to get the correct environment setup.

callegar commented 3 weeks ago

Thanks for the advice, now using --start. Does not change the issue with the floating context menus, though. Might indeed be plasma specific or even plasma 6 specific or plasma 6 on wayland specific.

totaam commented 3 weeks ago

Does not change the issue with the floating context menus

I didn't think it would. That's a separate issue.

plasma 6 on wayland specific

Yes, that's likely. Wayland makes all sorts of window positioning issues "interesting".

callegar commented 3 weeks ago

Also reported at KDE https://bugs.kde.org/show_bug.cgi?id=488208

callegar commented 3 weeks ago

Seems 100% reproducible for me, so I hope they can check it.

totaam commented 3 weeks ago

@callegar they're probably going to say that xpra is at fault.

callegar commented 3 weeks ago

Even if it was, which may well not be, I hope they will help by looking into it. xpra is a too important piece for having it misbehave in KDE, IMHO. Furthermore, the post X era where each DE has its own implementation of the wayland protocols really requires a lot of cooperation to assure that things remain consistent across desktops.

callegar commented 1 week ago

Issue is actually not limited to VirtualBox. I see a similar behavior with konsole. If I go on the sandwich button and press it, then a menu appears. When I try to show a submenu, the submenu flashes and disappears. At the same time I get messages such as:

(Xpra:54999): Gdk-WARNING **: 16:14:13.755: Couldn't map as window 0x620b98e10110 as popup because it doesn't have a parent

(Xpra:54999): Gdk-WARNING **: 16:14:18.089: Tried to map a popup with a non-top most parent

(Xpra:54999): Gdk-WARNING **: 16:14:20.503: Tried to map a popup with a non-top most parent
Gdk-Message: 16:14:33.630: Window 0x620b98e29c30 is a temporary window without parent, application will not be able to position it on screen.
callegar commented 1 week ago

In any case, forcing the xpra client to work in X11 mode rather than in wayland mode works around the issue. Enough to do GDK_BACKEND=x11 xpra attach --ssh=ssh --dpi <dpi> ssh://<host>/<display> --start konsole.

totaam commented 1 week ago

I see a similar behavior with konsole

Works fine here on Fedora + Gnome Shell.

The problem comes from this: Window 0x620b98e29c30 is a temporary window without parent, application will not be able to position it on screen.

X11 applications routinely place their windows wherever they like, but Wayland decided to break the vast majority of existing applications by not providing an API for doing that (it does exist, as can be seen when using XWayland). We try hard to find a parent: https://github.com/Xpra-org/xpra/blob/28bc4c6f60d6ae46eb187314364782146cad5605/xpra/client/mixins/windows.py#L880-L893 https://github.com/Xpra-org/xpra/blob/28bc4c6f60d6ae46eb187314364782146cad5605/xpra/client/mixins/windows.py#L871-L878 And there's only so much guessing we can do without getting it wrong. Perhaps the version of VirtualBox also makes a difference: newer versions are more likely to bend over backwards to try to satisfy all these new Wayland windows relationship restrictions.