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 735531 - Make tooltips use subsurfaces on wayland
Make tooltips use subsurfaces on wayland
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-08-27 15:51 UTC by Carlos Garnacho
Modified: 2014-08-28 14:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tooltip: Use subsurfaces on wayland (1.86 KB, patch)
2014-08-27 15:52 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2014-08-27 15:51:20 UTC
On wayland, tooltips windows currently get shown as a xdg_popup, which is not designed for tooltips, as it involves compositor grabs, and actually takes the focus away of the window being tipped about.

I'm attaching a small patch that uses the same trick on popovers than on entry completion windows, so tooltips are rendered on a subsurface, and act on wayland as you'd expect.
Comment 1 Carlos Garnacho 2014-08-27 15:52:22 UTC
Created attachment 284618 [details] [review]
tooltip: Use subsurfaces on wayland

This places tooltips in the right place, and avoids having those attempt
to steal the focus.
Comment 2 Matthias Clasen 2014-08-27 16:53:26 UTC
Review of attachment 284618 [details] [review]:

::: gtk/gtktooltip.c
@@ +910,3 @@
+                                  GTK_WINDOW (window_widget));
+  else
+    gtk_window_set_transient_for (GTK_WINDOW (tooltip->window), NULL);

If we ever hit the 'no transient parent' case, will that break with subsurfaces ? What do we do in that case under Wayland ?
Comment 3 Carlos Garnacho 2014-08-27 18:10:45 UTC
(In reply to comment #2)
> Review of attachment 284618 [details] [review]:
> 
> ::: gtk/gtktooltip.c
> @@ +910,3 @@
> +                                  GTK_WINDOW (window_widget));
> +  else
> +    gtk_window_set_transient_for (GTK_WINDOW (tooltip->window), NULL);
> 
> If we ever hit the 'no transient parent' case, will that break with subsurfaces
> ? What do we do in that case under Wayland ?

In that case the wl_subsurface is internally lost, but the wl_surface may remain to create a new wl_subsurface interface for it, the surface is no wl_shell_surface nor xdg_surface either, so is nothing the compositor would show.

In the specific case of tooltips, the tooltip window is also on its way to being hidden, which would mean the wl_surface is gone too, until both resources are created when the tooltip is needed again (and set_window()/show() happens again on it)
Comment 4 Matthias Clasen 2014-08-27 18:32:08 UTC
Review of attachment 284618 [details] [review]:

ok then
Comment 5 Carlos Garnacho 2014-08-28 14:42:56 UTC
Attachment 284618 [details] pushed as 3df8b95 - tooltip: Use subsurfaces on wayland