[empathy] Always forward to the view keynav events, since we get them only if they are useless to the entry an



commit 12c7f7de95068377ff60b23bdc5d80367d554c2b
Author: Xavier Claessens <xclaesse gmail com>
Date:   Fri May 20 15:18:10 2011 +0200

    Always forward to the view keynav events, since we get them only if they are useless to the entry anyway

 libempathy-gtk/empathy-contact-list-view.c |   16 ++++++----------
 libempathy-gtk/empathy-individual-view.c   |   18 ++++++------------
 2 files changed, 12 insertions(+), 22 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 03839ab..2b0b51a 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -1283,19 +1283,15 @@ contact_list_view_search_key_navigation_cb (GtkWidget *search,
 					    GdkEvent *event,
 					    EmpathyContactListView *view)
 {
-	GdkEventKey *eventkey = ((GdkEventKey *) event);
+	GdkEvent *new_event;
 	gboolean ret = FALSE;
 
-	if (eventkey->keyval == GDK_KEY_Up || eventkey->keyval == GDK_KEY_Down) {
-		GdkEvent *new_event;
+	new_event = gdk_event_copy (event);
+	gtk_widget_grab_focus (GTK_WIDGET (view));
+	ret = gtk_widget_event (GTK_WIDGET (view), new_event);
+	gtk_widget_grab_focus (search);
 
-		new_event = gdk_event_copy (event);
-		gtk_widget_grab_focus (GTK_WIDGET (view));
-		ret = gtk_widget_event (GTK_WIDGET (view), new_event);
-		gtk_widget_grab_focus (search);
-
-		gdk_event_free (new_event);
-	}
+	gdk_event_free (new_event);
 
 	return ret;
 }
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index dbd8f33..b5c5022 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -1409,21 +1409,15 @@ individual_view_search_key_navigation_cb (GtkWidget *search,
   GdkEvent *event,
   EmpathyIndividualView *view)
 {
-  GdkEventKey *eventkey = ((GdkEventKey *) event);
+  GdkEvent *new_event;
   gboolean ret = FALSE;
 
-  if (eventkey->keyval == GDK_KEY_Up || eventkey->keyval == GDK_KEY_Down
-      || eventkey->keyval == GDK_KEY_F2)
-    {
-      GdkEvent *new_event;
-
-      new_event = gdk_event_copy (event);
-      gtk_widget_grab_focus (GTK_WIDGET (view));
-      ret = gtk_widget_event (GTK_WIDGET (view), new_event);
-      gtk_widget_grab_focus (search);
+  new_event = gdk_event_copy (event);
+  gtk_widget_grab_focus (GTK_WIDGET (view));
+  ret = gtk_widget_event (GTK_WIDGET (view), new_event);
+  gtk_widget_grab_focus (search);
 
-      gdk_event_free (new_event);
-    }
+  gdk_event_free (new_event);
 
   return ret;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]