mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
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.
This commit is contained in:
parent
67728ac004
commit
f0f39c34f8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user