Window: Avoid some redundant assignments

This commit is contained in:
Timm Bäder 2020-01-02 13:52:14 +01:00
parent 04899e3707
commit 726909d735

View File

@ -1570,21 +1570,22 @@ device_removed_cb (GdkSeat *seat,
{
GtkWindow *window = user_data;
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GList *l = priv->foci, *cur;
GList *l = priv->foci;
while (l)
{
GList *next;
GtkPointerFocus *focus = l->data;
cur = l;
focus = cur->data;
l = cur->next;
next = l->next;
if (focus->device == device)
{
priv->foci = g_list_delete_link (priv->foci, cur);
priv->foci = g_list_delete_link (priv->foci, l);
gtk_pointer_focus_unref (focus);
}
l = next;
}
}
@ -9294,15 +9295,15 @@ gtk_window_update_pointer_focus_on_state_change (GtkWindow *window,
GtkWidget *widget)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GList *l = priv->foci, *cur;
GList *l = priv->foci;
while (l)
{
GList *next;
GtkPointerFocus *focus = l->data;
cur = l;
focus = cur->data;
l = cur->next;
next = l->next;
gtk_pointer_focus_ref (focus);
@ -9314,9 +9315,9 @@ gtk_window_update_pointer_focus_on_state_change (GtkWindow *window,
if (GTK_WIDGET (focus->toplevel) == widget)
{
/* Unmapping the toplevel, remove pointer focus */
priv->foci = g_list_remove_link (priv->foci, cur);
priv->foci = g_list_remove_link (priv->foci, l);
gtk_pointer_focus_unref (focus);
g_list_free (cur);
g_list_free (l);
}
else if (focus->target == widget ||
gtk_widget_is_ancestor (focus->target, widget))
@ -9325,6 +9326,8 @@ gtk_window_update_pointer_focus_on_state_change (GtkWindow *window,
}
gtk_pointer_focus_unref (focus);
l = next;
}
}
@ -9334,15 +9337,13 @@ gtk_window_maybe_revoke_implicit_grab (GtkWindow *window,
GtkWidget *grab_widget)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GList *l = priv->foci, *cur;
GList *l = priv->foci;
while (l)
{
GtkPointerFocus *focus = l->data;
cur = l;
focus = cur->data;
l = cur->next;
l = l->next;
if (focus->toplevel != window)
continue;