popovermenu: Only close if there's a new focus widget

Makes sense and otherwise we end up closing the popover for no reason
This commit is contained in:
Timm Bäder
2019-10-06 12:50:22 +02:00
parent bd9687a4f2
commit fb1145d72d

View File

@@ -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)