Xpra: Ticket #556: Qt 5 menus closing immediately

Since version 0.12.0-1 menus of qt 5.0 apps are closed immediately. You only see the menu flash open for a very short time. The left click window menu and the right click context menus are affected. Going back to 0.11.6-1 fixes the issue.

The server is running on Ubuntu Saucy 64-bit and I tested with a local (mmap) client and a remote Windows client. The client type and version makes no difference, only the server version seems to matter.

Mon, 07 Apr 2014 13:29:07 GMT - Antoine Martin: owner, priority, status changed

Do you have an example application I can use for testing?

Mon, 07 Apr 2014 13:38:41 GMT - rikky:

I see this issue with Qt Creator 3.

Mon, 07 Apr 2014 14:15:58 GMT - rikky:

Sorry. Forgot to mention. I start qtcreator in a chroot and therefore qtcreator uses some older X client libs than in default Ubuntu Saucy. Maybe the blinking menu is related to these libs. i.e libxext6 2:1.1.1-2ubuntu0.1 instead of 2:1.3.2-1

Mon, 07 Apr 2014 14:16:57 GMT - Antoine Martin: attachment set

disables the grab helper code

Mon, 07 Apr 2014 14:18:23 GMT - Antoine Martin:

Thanks for the details, I believe I have narrowed it down to the new "grab" code in 0.12

You should be able to work as normal by applying attachment/ticket/556/disable-grabs.patch, it works for me with the qt5 calculator example's context menu.

Mon, 07 Apr 2014 14:31:48 GMT - rikky:

That was quick. Thanks. The patch works great. The right click menu is perfect now. The window menu context is drawn a little bit to high, but that is not an real issue. Thanks

Mon, 07 Apr 2014 14:55:13 GMT - Antoine Martin:

The plot thickens: it only misbehaves if I have another xpra window active anywhere on screen (ie: even just an xterm), but not if it is minimized.

I think that the grab code ends up listening for too many windows, and emits an ungrab for the other window, causing the menu to close.

Tue, 08 Apr 2014 04:23:04 GMT - Antoine Martin:

With just the calculator shown (wid=2, xid=0xa00006=10485766L): I focus it, right click in the text area, the menu comes up, then I click outside it and it disappears:

Now with the xterm (wid=1, xid=0x800022=8388642) also shown (buggy):

Tue, 08 Apr 2014 10:17:48 GMT - Antoine Martin: owner, status changed

With r6057, r6058 and r6059 applied, I managed to get enough debugging info to see where the problem was: the PointerGrabHelper for each window ended up listening on all the windows up to and including the world window which we use for focus events. So when the grab happened on the second window, both windows got the grab events and we duly forwarded one after the other to the client, which caused a focus event when the first one lost its grab to the second one... breaking the grab and closing the menu window.

r6060 fixes this. It isn't particularly elegant as it introduces a dependency from the window helpers to the world window - which is a little ugly, but it solves the problem for me, and this is the minimal patch suitable for a v0.12.x backport. I may yet do things differently for trunk if I can find a cleaner or better approach. Also, the same thing may be useful for CompositeHelper and may prevent unnecessary pixmap refreshes on focus events.

@rikky: does r6060 work for you too?


The window menu context is drawn a little bit too high, but that is not an real issue

I have moved this one to #557, it is actually a huge regression - please take a look.

Thu, 10 Apr 2014 12:12:28 GMT - rikky:

I just tested with 0.12.3-1 and this issue is fixed. Also the position of the context menu is perfect now. thanks

Thu, 10 Apr 2014 13:54:44 GMT - rikky: status changed; resolution set

Sat, 19 Apr 2014 03:49:51 GMT - Antoine Martin:

Unfortunately... this broke grabs (#139).

Sat, 23 Jan 2021 04:59:16 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/556