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 759018 - wayland: tests/testtooltips custom tooltip misplaced at (0,0) on Wayland
wayland: tests/testtooltips custom tooltip misplaced at (0,0) on Wayland
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-12-04 10:25 UTC by Olivier Fourdan
Modified: 2015-12-04 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: fix testtooltips (1.56 KB, patch)
2015-12-04 10:28 UTC, Olivier Fourdan
none Details | Review
wayland: fix testtooltips (1.20 KB, patch)
2015-12-04 10:58 UTC, Olivier Fourdan
committed Details | Review

Description Olivier Fourdan 2015-12-04 10:25:54 UTC
Summary:

On Wayland for tooltips tp works as ecpedted the type hint must be set to tooltips, otherwise the popup window won't be translated as a subsurface in Wayland.

The tests/testtooltips doesn't do that for its custom tooltip example.

Steps to reproduce

 - Run a Wayland session
 - From gtk+ source tree, run ./tests/testtooltips
 - hover "This one has a custome tooltip window" label

Actual result

"blaat" written in black over dark blue appears at (0,0)

Expected result

"blaat" written in black over dark blue appears next to the pointer/label

Additional info:

Patch to be attached in a sec once I have this bugzilla number created
Comment 1 Olivier Fourdan 2015-12-04 10:28:47 UTC
Created attachment 316757 [details] [review]
wayland: fix testtooltips

On Wayland, for tooltips to work as expected, the type hint must be set to tooltips, otherwise the popup window won't be translated as a subsurface.
    
Fix the test do work as expected under Wayland.
Comment 2 Emmanuele Bassi (:ebassi) 2015-12-04 10:42:14 UTC
Review of attachment 316757 [details] [review]:

::: tests/testtooltips.c
@@ +60,3 @@
   GtkWindow *window = gtk_widget_get_tooltip_window (widget);
 
+  gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_TOOLTIP);

I wonder why you put these here, instead of setting the hint and the transient-for bits when creating tooltip_window.
Comment 3 Olivier Fourdan 2015-12-04 10:58:53 UTC
Created attachment 316763 [details] [review]
wayland: fix testtooltips

(In reply to Emmanuele Bassi (:ebassi) from comment #2)
> Review of attachment 316757 [details] [review] [review]:
> 
> ::: tests/testtooltips.c
> @@ +60,3 @@
>    GtkWindow *window = gtk_widget_get_tooltip_window (widget);
>  
> +  gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_TOOLTIP);
> 
> I wonder why you put these here, instead of setting the hint and the
> transient-for bits when creating tooltip_window.

Yeah, that would work equally well. Updated patch attached.
Comment 4 Emmanuele Bassi (:ebassi) 2015-12-04 11:02:32 UTC
Review of attachment 316763 [details] [review]:

Looks good to me.
Comment 5 Emmanuele Bassi (:ebassi) 2015-12-04 11:02:32 UTC
Review of attachment 316763 [details] [review]:

Looks good to me.
Comment 6 Olivier Fourdan 2015-12-04 12:19:28 UTC
Review of attachment 316763 [details] [review]:

attachment 316763 [details] [review] pushed a commit 7fc493a wayland: fix testtooltips
Comment 7 Olivier Fourdan 2015-12-04 12:19:49 UTC
Closing now