tooltip: don't cross native boundaries
authorZander Brown <zbrown@gnome.org>
Sun, 27 Aug 2023 00:54:56 +0000 (01:54 +0100)
committerZander Brown <zbrown@gnome.org>
Tue, 29 Aug 2023 00:48:26 +0000 (01:48 +0100)
When walking the tree looking for tooltips we shouldn't cross from, say,
a popover to it's parent window

Fix: https://gitlab.gnome.org/GNOME/gtk/-/issues/1234
Fix: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1038
Fix: https://gitlab.gnome.org/GNOME/gtk/-/issues/5998
Fix: https://gitlab.gnome.org/GNOME/nautilus/-/issues/3063
See: https://gitlab.gnome.org/GNOME/console/-/issues/318
See: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6346

gtk/gtktooltip.c

index c007b1641b1b60dd44de002807aeb0080f6b9a36..7bc11a694cad345d148673bf8a41362c00ba5838 100644 (file)
@@ -302,8 +302,8 @@ gtk_tooltip_set_icon_from_gicon (GtkTooltip  *tooltip,
  * Replaces the widget packed into the tooltip with
  * @custom_widget. @custom_widget does not get destroyed when the tooltip goes
  * away.
- * By default a box with a `GtkImage` and `GtkLabel` is embedded in 
- * the tooltip, which can be configured using gtk_tooltip_set_markup() 
+ * By default a box with a `GtkImage` and `GtkLabel` is embedded in
+ * the tooltip, which can be configured using gtk_tooltip_set_markup()
  * and gtk_tooltip_set_icon().
  */
 void
@@ -560,6 +560,9 @@ gtk_tooltip_run_requery (GtkWidget  **widget,
         {
           GtkWidget *parent = gtk_widget_get_parent (*widget);
 
+          if (GTK_IS_NATIVE (*widget))
+            break;
+
           if (parent)
             {
               graphene_point_t r = GRAPHENE_POINT_INIT (*x, *y);