diff options
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 8 | ||||
-rw-r--r-- | libempathy-gtk/empathy-live-search.c | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 92bdeacf5..a479268a0 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1283,23 +1283,27 @@ individual_view_search_activate_cb (GtkWidget *search, } } -static void +static gboolean individual_view_search_key_navigation_cb (GtkWidget *search, GdkEvent *event, EmpathyIndividualView *view) { GdkEventKey *eventkey = ((GdkEventKey *) event); + gboolean ret = FALSE; + if (eventkey->keyval == GDK_Up || eventkey->keyval == GDK_Down) { GdkEvent *new_event; new_event = gdk_event_copy (event); gtk_widget_grab_focus (GTK_WIDGET (view)); - gtk_widget_event (GTK_WIDGET (view), new_event); + ret = gtk_widget_event (GTK_WIDGET (view), new_event); gtk_widget_grab_focus (search); gdk_event_free (new_event); } + + return ret; } static void diff --git a/libempathy-gtk/empathy-live-search.c b/libempathy-gtk/empathy-live-search.c index 3b6e18ee3..c029d0f5b 100644 --- a/libempathy-gtk/empathy-live-search.c +++ b/libempathy-gtk/empathy-live-search.c @@ -30,6 +30,7 @@ #include <libempathy/empathy-utils.h> #include "empathy-live-search.h" +#include "empathy-gtk-marshal.h" G_DEFINE_TYPE (EmpathyLiveSearch, empathy_live_search, GTK_TYPE_HBOX) @@ -132,6 +133,7 @@ live_search_entry_key_pressed_cb (GtkEntry *entry, gpointer user_data) { EmpathyLiveSearch *self = EMPATHY_LIVE_SEARCH (user_data); + gboolean ret; /* if esc key pressed, hide the search */ if (event->keyval == GDK_Escape) @@ -144,8 +146,8 @@ live_search_entry_key_pressed_cb (GtkEntry *entry, if (event->keyval == GDK_Up || event->keyval == GDK_Down || event->keyval == GDK_Left || event->keyval == GDK_Right) { - g_signal_emit (self, signals[KEYNAV], 0, event); - return TRUE; + g_signal_emit (self, signals[KEYNAV], 0, event, &ret); + return ret; } return FALSE; @@ -393,9 +395,9 @@ empathy_live_search_class_init (EmpathyLiveSearchClass *klass) G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, - NULL, NULL, - g_cclosure_marshal_VOID__BOXED, - G_TYPE_NONE, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); + g_signal_accumulator_true_handled, NULL, + _empathy_gtk_marshal_BOOLEAN__BOXED, + G_TYPE_BOOLEAN, 1, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); param_spec = g_param_spec_object ("hook-widget", "Live Searchs Hook Widget", "The live search catches key-press-events on this widget", |