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.
Do you have an example application I can use for testing?
I see this issue with Qt Creator 3.
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
disables the grab helper code
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.
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
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.
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:
10:58:35,975 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, \ 'detail': 3, 'mode': 0, 'serial': 1872L, 'type': 10 \ }>) mode=NotifyNormal 10:58:38,347 PointerGrabHelper.__init__(0xa0000f) 10:58:38,351 grab: listening for: ['0xa0000fL'] 10:58:38,352 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194334L, 'xid': 4194334L, \ 'detail': 4, 'mode': 1, 'serial': 2256L, 'type': 10 \ }>) mode=NotifyGrab 10:58:38,352 emitting grab on PointerGrabHelper(0xa00006) 10:58:45,207 focus_in_event(<X11Event { 'send_event': 0, 'delivered_to_xid': 4194334L, 'xid': 4194334L, \ 'detail': 4, 'mode': 2, 'serial': 2874L, 'type': 9 \ }>) mode=NotifyUngrab 10:58:45,208 emitting ungrab on PointerGrabHelper(0xa00006) 10:58:45,211 force ungrab (has_grab=False) destroying window 10:58:45,212 grab: unmap <X11Event { \ 'send_event': 0, 'delivered_to_xid': 10485775L, 'xid': 10485775L, \ 'serial': 2874L, 'type': 18}> 10:58:45,212 force ungrab (has_grab=False) <X11Event { \ 'send_event': 0, 'delivered_to_xid': 10485775L, 'xid': 10485775L, \ 'serial': 2874L, 'type': 18}>
10:58:35,972 focus-in-event for wid=2 10:58:35,972 GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) \ focus_change((ClientWindow(2), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=False, has-toplevel-focus=True, _been_mapped=True 10:58:35,973 update_focus(2, True) _focused=None 10:58:35,973 send_focus(2) 10:58:38,402 grabbing GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) 10:58:45,212 ungrabbing GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) 10:58:45,215 _unfocus() wid=3 10:58:45,915 focus-out-event for wid=2 10:58:45,916 GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) \ focus_change((ClientWindow(2), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=True, has-toplevel-focus=False, _been_mapped=True 10:58:45,916 update_focus(2, False) _focused=2 10:58:45,916 send_focus(0)
Now with the xterm (wid=1, xid=0x800022=8388642) also shown (buggy):
11:10:21,615 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 0, 'serial': 4326L, 'type': 10 \ }>) mode=NotifyNormal 11:10:21,615 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 0, 'serial': 4326L, 'type': 10, \ }>) mode=NotifyNormal 11:10:23,365 PointerGrabHelper.__init__(0xa00014) 11:10:23,369 grab: listening for: ['0xa00014L'] 11:10:23,373 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194334L, 'xid': 4194334L, 'detail': 4, \ 'mode': 1, 'serial': 4507L, 'type': 10, \ }>) mode=NotifyGrab 11:10:23,373 emitting grab on PointerGrabHelper(0x800022) 11:10:23,373 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194334L, 'xid': 4194334L, 'detail': 4, \ 'mode': 1, 'serial': 4507L, 'type': 10, \ }>) mode=NotifyGrab 11:10:23,373 emitting grab on PointerGrabHelper(0xa00006) 11:10:23,494 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 3, 'serial': 4590L, 'type': 9, \ }>) mode=None 11:10:23,495 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 3, 'serial': 4590L, 'type': 9, \ }>) mode=None 11:10:23,495 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194334L, 'xid': 4194334L, 'detail': 4, \ 'mode': 2, 'serial': 4591L, 'type': 9, \ }>) mode=NotifyUngrab 11:10:23,496 emitting ungrab on PointerGrabHelper(0x800022) 11:10:23,496 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194334L, 'xid': 4194334L, 'detail': 4, \ 'mode': 2, 'serial': 4591L, 'type': 9, \ }>) mode=NotifyUngrab 11:10:23,496 emitting ungrab on PointerGrabHelper(0xa00006) 11:10:23,498 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 2, 'serial': 4591L, 'type': 9, \ }>) mode=NotifyUngrab 11:10:23,498 emitting ungrab on PointerGrabHelper(0x800022) 11:10:23,498 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 2, 'serial': 4591L, 'type': 9, \ }>) mode=NotifyUngrab 11:10:23,499 emitting ungrab on PointerGrabHelper(0xa00006) 11:10:23,500 force ungrab (has_grab=False) destroying window 11:10:23,500 grab: unmap <X11Event { \ 'send_event': 0, 'delivered_to_xid': 10485780L, 'xid': 10485780L, \ 'serial': 4591L, 'type': 18}> 11:10:23,500 force ungrab (has_grab=False) <X11Event { \ 'send_event': 0, 'delivered_to_xid': 10485780L, 'xid': 10485780L, \ 'serial': 4591L, 'type': 18}> 11:10:23,518 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 0, 'serial': 4637L, 'type': 10, \ }>) mode=NotifyNormal 11:10:23,518 focus_out_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 0, 'serial': 4637L, 'type': 10, \ }>) mode=NotifyNormal 11:10:25,303 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 0, 'serial': 4735L, 'type': 9, \ }>) mode=NotifyNormal 11:10:25,303 focus_in_event(<X11Event { \ 'send_event': 0, 'delivered_to_xid': 4194335L, 'xid': 4194335L, 'detail': 3, \ 'mode': 0, 'serial': 4735L, 'type': 9, \ }>) mode=NotifyNormal
11:10:21,612 focus-in-event for wid=2 11:10:21,613 GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) \ focus_change((ClientWindow(2), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=False, has-toplevel-focus=True, _been_mapped=True 11:10:21,613 update_focus(2, True) _focused=None 11:10:21,613 send_focus(2) 11:10:23,460 grabbing GLClientWindow(1 : GLPixmapBacking(1, (499, 316), None)) 11:10:23,461 grabbing GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) 11:10:23,490 focus-out-event for wid=2 11:10:23,490 GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) \ focus_change((ClientWindow(2), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=True, has-toplevel-focus=False, _been_mapped=True 11:10:23,491 update_focus(2, False) _focused=2 11:10:23,491 send_focus(0) 11:10:23,492 focus-in-event for wid=1 11:10:23,492 GLClientWindow(1 : GLPixmapBacking(1, (499, 316), None)) \ focus_change((ClientWindow(1), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=False, has-toplevel-focus=True, _been_mapped=True 11:10:23,492 update_focus(1, True) _focused=None 11:10:23,493 send_focus(1) 11:10:23,493 focus-out-event for wid=1 11:10:23,494 GLClientWindow(1 : GLPixmapBacking(1, (499, 316), None)) \ focus_change((ClientWindow(1), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=True, has-toplevel-focus=False, _been_mapped=True 11:10:23,494 update_focus(1, False) _focused=1 11:10:23,494 send_focus(0) 11:10:23,494 focus-in-event for wid=2 11:10:23,494 GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) \ focus_change((ClientWindow(2), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=False, has-toplevel-focus=True, _been_mapped=True 11:10:23,495 update_focus(2, True) _focused=None 11:10:23,495 send_focus(2) 11:10:23,497 ungrabbing GLClientWindow(1 : GLPixmapBacking(1, (499, 316), None)) 11:10:23,498 ungrabbing GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) 11:10:23,531 ungrabbing GLClientWindow(1 : GLPixmapBacking(1, (499, 316), None)) 11:10:23,531 ungrabbing GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) 11:10:23,534 _unfocus() wid=4 11:10:25,299 focus-out-event for wid=2 11:10:25,299 GLClientWindow(2 : GLPixmapBacking(2, (314, 301), None)) \ focus_change((ClientWindow(2), <GParamBoolean 'has-toplevel-focus'>)) \ had-toplevel-focus=True, has-toplevel-focus=False, _been_mapped=True 11:10:25,300 update_focus(2, False) _focused=2 11:10:25,300 send_focus(0)
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?
Regarding:
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.
I just tested with 0.12.3-1 and this issue is fixed. Also the position of the context menu is perfect now. thanks
Unfortunately... this broke grabs (#139).
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/556