aboutsummaryrefslogtreecommitdiff
path: root/src/idoentrymenuitem.c
diff options
context:
space:
mode:
authorCody Russell <crussell@canonical.com>2010-03-16 11:10:39 -0500
committerCody Russell <crussell@canonical.com>2010-03-16 11:10:39 -0500
commite965ac4cbe01be58a5f8ef2669eedf0389e4bc68 (patch)
treea91cb01623a16ef7f984f1364be202cb1dbaed89 /src/idoentrymenuitem.c
parent7561ce13586a6d1549aec43dba138473d50b480b (diff)
parentd6a2f217fe40c40baee2f9660554647d8c89d38e (diff)
downloadayatana-ido-e965ac4cbe01be58a5f8ef2669eedf0389e4bc68.tar.gz
ayatana-ido-e965ac4cbe01be58a5f8ef2669eedf0389e4bc68.tar.bz2
ayatana-ido-e965ac4cbe01be58a5f8ef2669eedf0389e4bc68.zip
Don't capture up/down keys. Compile fixes for latest gtk+.
Diffstat (limited to 'src/idoentrymenuitem.c')
-rw-r--r--src/idoentrymenuitem.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/idoentrymenuitem.c b/src/idoentrymenuitem.c
index ff90544..8cac5b6 100644
--- a/src/idoentrymenuitem.c
+++ b/src/idoentrymenuitem.c
@@ -120,6 +120,24 @@ ido_entry_menu_item_button_release (GtkWidget *widget,
}
static gboolean
+is_key_press_valid (IdoEntryMenuItem *item,
+ gint key)
+{
+ switch (key)
+ {
+ case GDK_Escape:
+ case GDK_Up:
+ case GDK_Down:
+ case GDK_KP_Up:
+ case GDK_KP_Down:
+ return FALSE;
+
+ default:
+ return TRUE;
+ }
+}
+
+static gboolean
ido_entry_menu_item_key_press (GtkWidget *widget,
GdkEventKey *event,
gpointer data)
@@ -127,7 +145,7 @@ ido_entry_menu_item_key_press (GtkWidget *widget,
IdoEntryMenuItem *menuitem = (IdoEntryMenuItem *)data;
if (menuitem->priv->selected &&
- event->keyval != GDK_Escape)
+ is_key_press_valid (menuitem, event->keyval))
{
gtk_widget_event (menuitem->priv->entry,
((GdkEvent *)(void*)(event)));
@@ -140,7 +158,7 @@ ido_entry_menu_item_key_press (GtkWidget *widget,
static void
ido_entry_menu_item_send_focus_change (GtkWidget *widget,
- gboolean in)
+ gboolean in)
{
GdkEvent *event = gdk_event_new (GDK_FOCUS_CHANGE);
@@ -182,7 +200,7 @@ ido_entry_menu_item_button_press (GtkWidget *widget,
gdk_window_raise (entry->window);
}
- if (!GTK_WIDGET_HAS_FOCUS (entry))
+ if (!gtk_widget_has_focus (entry))
{
gtk_widget_grab_focus (entry);
}