summaryrefslogtreecommitdiff
path: root/gtk/gtktooltip.c
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2009-09-29 23:45:03 -0400
committerMatthias Clasen <mclasen@redhat.com>2009-09-29 23:45:03 -0400
commitf0f39c34f807dcd4775415f1b7604b9debc16c60 (patch)
treec4f3c7394c8b2f72340fc1a7c636142f8021e369 /gtk/gtktooltip.c
parent67728ac004eff3cb2175a8c1db9bfbc749985cda (diff)
downloadgtk+-f0f39c34f807dcd4775415f1b7604b9debc16c60.tar.gz
Update last_window only when needed
_gtk_tooltip_handle_event, which is called for many events in the GTK+ main loop, calls gtk_tooltip_set_last_window, which keeps a weak reference to the last window we passed through. If the window being set is the same than the last one there's really no need to update our weak reference, so add a check for that and exit early.
Diffstat (limited to 'gtk/gtktooltip.c')
-rw-r--r--gtk/gtktooltip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index c816d0e7f9..66b29f1b77 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -768,6 +768,9 @@ static void
gtk_tooltip_set_last_window (GtkTooltip *tooltip,
GdkWindow *window)
{
+ if (tooltip->last_window == window)
+ return;
+
if (tooltip->last_window)
g_object_remove_weak_pointer (G_OBJECT (tooltip->last_window),
(gpointer *) &tooltip->last_window);