[gtk/wip/baedert/for-master: 13/25] popovermenu: Only close if there's a new focus widget
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 13/25] popovermenu: Only close if there's a new focus widget
- Date: Wed, 9 Oct 2019 14:43:45 +0000 (UTC)
commit 670ab9fb98af4e328fc7aff506fdd263ac5a04df
Author: Timm Bäder <mail baedert org>
Date: Sun Oct 6 12:50:22 2019 +0200
popovermenu: Only close if there's a new focus widget
Makes sense and otherwise we end up closing the popover for no reason
gtk/gtkpopovermenu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c
index fdc053e6e4..5249941a78 100644
--- a/gtk/gtkpopovermenu.c
+++ b/gtk/gtkpopovermenu.c
@@ -215,7 +215,10 @@ focus_out (GtkEventControllerKey *controller,
GdkNotifyType detail,
GtkPopoverMenu *menu)
{
- if (!gtk_event_controller_key_contains_focus (controller))
+ GtkWidget *new_focus = gtk_root_get_focus (gtk_widget_get_root (GTK_WIDGET (menu)));
+
+ if (!gtk_event_controller_key_contains_focus (controller) &&
+ new_focus != NULL)
{
if (menu->parent_menu &&
GTK_POPOVER_MENU (menu->parent_menu)->open_submenu == (GtkWidget*) menu)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]