+#ifdef GDK_WINDOWING_WAYLAND
+ /* set the transient parent on the tooltip when running with the Wayland
+ * backend to allow correct positioning of the tooltip windows */
+ if (GDK_IS_WAYLAND_DISPLAY (display))
+ {
+ GtkWidget *toplevel;
+
+ toplevel = gtk_widget_get_toplevel (tooltip->tooltip_widget);
+ if (GTK_IS_WINDOW (toplevel))
+ gtk_window_set_transient_for (GTK_WINDOW (tooltip->current_window),
+ GTK_WINDOW (toplevel));
+ }
+#endif
+