From a4c5d1d94dea025df4736b19197959a0e82f8113 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 10 Jun 2021 14:01:41 -0700 Subject: [PATCH] window: clear move_focus when focus is already set This can get set in other places, so we need to ensure it is cleared so that an after-paint handler does not move the focus to a new widget. --- gtk/gtkwindow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 35ca93a481..a79e160582 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -2024,7 +2024,10 @@ gtk_window_root_set_focus (GtkRoot *root, return; if (focus == priv->focus_widget) - return; + { + priv->move_focus = FALSE; + return; + } if (priv->focus_widget) old_focus = g_object_ref (priv->focus_widget);