Commit 8d5d9c50 authored by Thomas Wood's avatar Thomas Wood

tooltip: set the transient parent when using the Wayland backend

Set the transient parent window on tooltips so that they can be
positioned correctly when using the Wayland backend.
parent 134230ed
......@@ -36,6 +36,11 @@
#include "gtkwindowprivate.h"
#include "wayland/gdkwayland.h"
* SECTION:gtktooltip
* @Short_description: Add tips to your widgets
......@@ -1200,6 +1205,20 @@ found:
y = tooltip->last_y - height - 2;
/* set the transient parent on the tooltip when running with the Wayland
* backend to allow correct positioning of the tooltip windows */
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));
gtk_window_move (GTK_WINDOW (tooltip->current_window), x, y);
gtk_widget_show (GTK_WIDGET (tooltip->current_window));
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment