GNOME Bugzilla – Bug 766377
tooltip from xwayland app is still on screen when I alternate to a Wayland app
Last modified: 2016-06-23 06:54:01 UTC
Created attachment 327794 [details] bug demonstration steps to reproduce open Firefox and nautilus, put the mouse pointer on any bookmark bar item and wait the tooltip appears press super keyboard key and select nautilus window Result: tooltip from Firefox is still on screen Watch the video please.
This is reproducible on X11 as well. Unless you can reproduce the issue with a different XWayland app, it's like this[0] Firefox issue. [0] https://bugzilla.mozilla.org/show_bug.cgi?id=411268
I can reproduce using Opera browser instead Firefox too.
Can you reproduce with the following: GDK_BACKEND=x11 gtk3-demo --run=toolpalette
Yes, I get the same result.
Yes, I can reproduce as well using gnome-shell's window picker (but not alt-tab)
Under X11, breaking on gtk_tooltip_hide_tooltip() in gtk/gtktooltip.c we see that the event that hides the tooltip is a leave notify event: Thread 1 "gtk3-demo" hit Breakpoint 1, gtk_tooltip_hide_tooltip (tooltip=tooltip@entry=0xd06cc0) at gtktooltip.c:1161 1161 if (!tooltip) (gdb) bt
+ Trace 236307
(gdb) p *event $1 = {type = GDK_LEAVE_NOTIFY, any = {type = GDK_LEAVE_NOTIFY, window = 0xcf9730, send_event = 0 '\000'}, ... crossing = {type = GDK_LEAVE_NOTIFY, window = 0xcf9730, send_event = 0 '\000', subwindow = 0xcf9e60, time = 997932303, x = 177, y = 148, x_root = 2211, y_root = 387, mode = GDK_CROSSING_NORMAL, detail = GDK_NOTIFY_NONLINEAR_VIRTUAL, focus = 0, state = 0}, ... } Under Wayland, there is no such leave notify event received and the tooltip is not hidden when the window picker is involved, and therefore shows up again after another window is picked.
Humm, I probably got confused with the "mode = GDK_CROSSING_NORMAL" reported in the GdkEvent in my comment 6, using GDK_DEBUG=events instead, we see that the crossing mode is actually 1 so taht would be GDK_CROSSING_GRAB, i.e. it's the LeaveNotify event generated by the pointer grab: Gdk-Message: leave notify: window 37748790 subwindow:0 device: 2 source device: 2 notify type: 3 crossing mode: 1 Which explains why we won't get these under Wayland...
Actually, even without a grab, I reckon we should still receive a LeaveNotify event because the pointer has left the Xwayland window for a native Wayland surface mapped by gnome-shell, but we don't. And we did, gtk+ would unmap the tooltip. So, filed bug https://bugs.freedesktop.org/show_bug.cgi?id=96437 for Xwayland and the patch submitted there would fix this issue as well (AFAICS)
The fix in Xwayland has landed in xserver upstream, closing this bug.