GNOME Bugzilla – Bug 695504
gtk-demo: entry completion doesn't work
Last modified: 2014-08-26 21:09:39 UTC
The entry completion example in gtk-demo has the popup flicker up, but it won't stay up.
this is a deficiency of the wayland protocol: it can't do popups without a pointer grab.
So I made some progress on this:
The window was being created as top level shell surface. This was because the window was not made transient for the parent. Adding this puts it down the popup code path in gdk_wayland_window_map which is progress.
Unfortunately the positioning seems to be wrong though.
As I've learned from Jasper, this is still broken because the popup window gets focus, which in turn causes the entry to loose focus and unmap the popup again.
So it ends up just flickering in.
The same problem also happens with tooltips - the tooltip appears, and the window goes to backdrop.
discussed at guadec, and vaguely agreed to look at using window type hints as a short-term fix if possible.
I tried to remove the device grabs for both the combobox list-mode popup and the entry completion popup, and couldn't observe any obvious brokenness under X - workspace switching, alt-tab and clicking outside all still worked as expected and didn't cause any obvious brokenness.
Created attachment 283227 [details] [review]
Couldn't test this under wayland - my jhbuilt mutter crashes at start.
I'm attaching a few patches to have this fixed by using subsurfaces, the patches here rely on the last batch of patches in bug #729215. With the entry completion popup being really a subsurface, the client-side gdk grabs make pointer/keyboard work as expected on wayland, and the behavior on other backends is left unchanged.
Created attachment 284193 [details] [review]
gtkwindow: Add private API to mark as subsurface
This is a rather hackish way to let GTK+ widgets declare popup windows
as subsurfaces, so they may work on wayland without the need of xdg_popup,
and without many changes yet on the GTK+ side.
Created attachment 284194 [details] [review]
entrycompletion: Mark popup window as subsurface on wayland
This will make the completion window use GDK_WINDOW_SUBSURFACE and be
shown relative to the parent window without involving compositor grabs.
Review of attachment 284193 [details] [review]:
Review of attachment 284194 [details] [review]:
Attachment 284193 [details] pushed as c38651c - gtkwindow: Add private API to mark as subsurface
Attachment 284194 [details] pushed as d04d29f - entrycompletion: Mark popup window as subsurface on wayland