Commit 77f4204b authored by Carlos Garnacho's avatar Carlos Garnacho

menu: Set up callback with a return function

The function hooked up to the ::key-pressed signal should have
a return value. Pointed out by Peter Bloomfield.
parent b442277f
......@@ -235,6 +235,11 @@ static void gtk_menu_enter (GtkEventController *controller,
gpointer user_data);
static void gtk_menu_leave (GtkEventController *controller,
gpointer user_data);
static gboolean gtk_menu_key_pressed (GtkEventControllerKey *controller,
guint keyval,
guint keycode,
GdkModifierType state,
GtkMenu *menu);
static void gtk_menu_scroll_to (GtkMenu *menu,
gint offset);
static void gtk_menu_grab_notify (GtkWidget *widget,
......@@ -1145,8 +1150,8 @@ gtk_menu_init (GtkMenu *menu)
priv->key_controller =
gtk_event_controller_key_new (GTK_WIDGET (menu));
g_signal_connect_swapped (priv->key_controller, "key-pressed",
G_CALLBACK (gtk_menu_stop_navigating_submenu), menu);
g_signal_connect (priv->key_controller, "key-pressed",
G_CALLBACK (gtk_menu_key_pressed), menu);
}
static void
......@@ -3481,6 +3486,17 @@ gtk_menu_leave (GtkEventController *controller,
gtk_menu_handle_scrolling (menu, event->x_root, event->y_root, FALSE, TRUE);
}
static gboolean
gtk_menu_key_pressed (GtkEventControllerKey *controller,
guint keyval,
guint keycode,
GdkModifierType state,
GtkMenu *menu)
{
gtk_menu_stop_navigating_submenu (menu);
return FALSE;
}
static gboolean
pointer_on_menu_widget (GtkMenu *menu,
gdouble x_root,
......
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