summaryrefslogtreecommitdiff
path: root/gtk/gtktooltip.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-06 13:56:27 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-06 14:27:45 -0400
commit1f0024a7f03510b66ebba15f2a5f51880a9fb549 (patch)
tree9123db85bd82a78261f352e068eba1dea007dc8a /gtk/gtktooltip.c
parentcb94c7d69e93cb34ba9db7d4cd06a52848044492 (diff)
downloadgtk+-1f0024a7f03510b66ebba15f2a5f51880a9fb549.tar.gz
tooltip: Add private api to allocate the window
Add private gtk_tooltip_maybe_allocate() function and use it from GtkWindow and GtkPopover. This will let us stop using the ::size-allocate signal, without having to redo all the tooltip management first. That will happen later.
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r--gtk/gtktooltip.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index f611b4f562..fc9e665444 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -977,3 +977,16 @@ gtk_tooltip_handle_event_internal (GdkEventType event_type,
break;
}
}
+
+void
+gtk_tooltip_maybe_allocate (GtkNative *native)
+{
+ GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (native));
+ GtkTooltip *tooltip;
+
+ tooltip = g_object_get_qdata (G_OBJECT (display), quark_current_tooltip);
+ if (!tooltip || GTK_NATIVE (tooltip->native) != native)
+ return;
+
+ gtk_native_check_resize (GTK_NATIVE (tooltip->window));
+}