[gtk: 5/72] Send focus events to the root
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 5/72] Send focus events to the root
- Date: Wed, 14 Oct 2020 19:08:10 +0000 (UTC)
commit 9b26660095a9d8776418847e3c83ffaca4ef1a4d
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 8 23:06:07 2020 -0400
Send focus events to the root
We are not propagating focus change events, and that is the only
place where we are listening for focus change events. If GtkWindow
does not see focus-in events for its popovers, we end up with
inadvertendly inactive windows.
Fixes: #3240
gtk/gtkmain.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 10780b7684..bffb4cfa94 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1648,8 +1648,11 @@ gtk_main_do_event (GdkEvent *event)
break;
case GDK_FOCUS_CHANGE:
- if (!_gtk_widget_captured_event (target_widget, event, target_widget))
- gtk_widget_event (target_widget, event, target_widget);
+ {
+ GtkWidget *root = GTK_WIDGET (gtk_widget_get_root (target_widget));
+ if (!_gtk_widget_captured_event (root, event, root))
+ gtk_widget_event (root, event, root);
+ }
break;
case GDK_KEY_PRESS:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]