Commit bf56f1a8 authored by Matthias Clasen's avatar Matthias Clasen

popovermenu: Actually listen to focus change

As it turns out, capture phase controllers
don't see any crossing events, so we need to
use separate controllers for key presses and
focus change.
parent 8cf231c3
......@@ -222,10 +222,14 @@ gtk_popover_menu_init (GtkPopoverMenu *popover)
controller = gtk_event_controller_key_new ();
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE);
g_signal_connect (controller, "focus-out", G_CALLBACK (focus_out), popover);
g_signal_connect (controller, "key-pressed", G_CALLBACK (key_pressed), popover);
gtk_widget_add_controller (GTK_WIDGET (popover), controller);
controller = gtk_event_controller_key_new ();
gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_BUBBLE);
g_signal_connect (controller, "focus-out", G_CALLBACK (focus_out), popover);
gtk_widget_add_controller (GTK_WIDGET (popover), controller);
/* Trigger mnemonics without Alt */
controllers = _gtk_widget_list_controllers (GTK_WIDGET (popover), GTK_PHASE_CAPTURE);
for (l = controllers; l; l = l->next)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment