After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 695504 - gtk-demo: entry completion doesn't work
gtk-demo: entry completion doesn't work
Product: gtk+
Classification: Platform
Component: Backend: Wayland
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Reported: 2013-03-09 16:20 UTC by Matthias Clasen
Modified: 2014-08-26 21:09 UTC
See Also:
GNOME target: 3.14
GNOME version: ---

test patch (2.84 KB, patch)
2014-08-12 17:44 UTC, Matthias Clasen
none Details | Review
gtkwindow: Add private API to mark as subsurface (2.27 KB, patch)
2014-08-22 12:51 UTC, Carlos Garnacho
committed Details | Review
entrycompletion: Mark popup window as subsurface on wayland (2.43 KB, patch)
2014-08-22 12:51 UTC, Carlos Garnacho
committed Details | Review

Description Matthias Clasen 2013-03-09 16:20:06 UTC
The entry completion example in gtk-demo has the popup flicker up, but it won't stay up.
Comment 1 Matthias Clasen 2013-04-07 04:35:12 UTC
this is a deficiency of the wayland protocol: it can't do popups without a pointer grab.
Comment 2 Rob Bradford 2013-04-19 17:01:50 UTC
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.
Comment 3 Matthias Clasen 2014-03-27 19:54:03 UTC
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.
Comment 4 Matthias Clasen 2014-08-01 06:51:07 UTC
discussed at guadec, and vaguely agreed to look at using window type hints as a short-term fix if possible.
Comment 5 Matthias Clasen 2014-08-12 17:41:36 UTC
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.
Comment 6 Matthias Clasen 2014-08-12 17:44:33 UTC
Created attachment 283227 [details] [review]
test patch

Couldn't test this under wayland - my jhbuilt mutter crashes at start.
Comment 7 Carlos Garnacho 2014-08-22 12:51:01 UTC
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.
Comment 8 Carlos Garnacho 2014-08-22 12:51:49 UTC
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.
Comment 9 Carlos Garnacho 2014-08-22 12:51:53 UTC
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.
Comment 10 Matthias Clasen 2014-08-26 20:20:59 UTC
Review of attachment 284193 [details] [review]:

Comment 11 Matthias Clasen 2014-08-26 20:22:04 UTC
Review of attachment 284194 [details] [review]:

Comment 12 Carlos Garnacho 2014-08-26 21:09:29 UTC
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