summaryrefslogtreecommitdiff
path: root/gtk/gtktooltip.c
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2013-02-07 11:27:00 +0000
committerThomas Wood <thomas.wood@intel.com>2013-02-12 15:30:56 +0000
commit8d5d9c50b12683a41f32880fc7ee4269deadd1fe (patch)
treec7a42b667dcb8b93c82b15fd0ea9931d759a068d /gtk/gtktooltip.c
parent134230ed91697728de76c98a7a5b16afbc9fe6e4 (diff)
downloadgtk+-8d5d9c50b12683a41f32880fc7ee4269deadd1fe.tar.gz
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. https://bugzilla.gnome.org/show_bug.cgi?id=693313
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r--gtk/gtktooltip.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index b4e0c954b7..aba9ffb38a 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -36,6 +36,11 @@
#include "gtkwindowprivate.h"
+#ifdef GDK_WINDOWING_WAYLAND
+#include "wayland/gdkwayland.h"
+#endif
+
+
/**
* SECTION:gtktooltip
* @Short_description: Add tips to your widgets
@@ -1200,6 +1205,20 @@ found:
y = tooltip->last_y - height - 2;
}
+#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
+
gtk_window_move (GTK_WINDOW (tooltip->current_window), x, y);
gtk_widget_show (GTK_WIDGET (tooltip->current_window));
}