diff options
author | Cody Russell <crussell@canonical.com> | 2010-03-16 11:10:39 -0500 |
---|---|---|
committer | Cody Russell <crussell@canonical.com> | 2010-03-16 11:10:39 -0500 |
commit | e965ac4cbe01be58a5f8ef2669eedf0389e4bc68 (patch) | |
tree | a91cb01623a16ef7f984f1364be202cb1dbaed89 /src | |
parent | 7561ce13586a6d1549aec43dba138473d50b480b (diff) | |
parent | d6a2f217fe40c40baee2f9660554647d8c89d38e (diff) | |
download | ayatana-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')
-rw-r--r-- | src/idoentrymenuitem.c | 24 | ||||
-rw-r--r-- | src/idoscalemenuitem.c | 6 |
2 files changed, 24 insertions, 6 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); } diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c index 7d16ec9..dc57479 100644 --- a/src/idoscalemenuitem.c +++ b/src/idoscalemenuitem.c @@ -135,8 +135,8 @@ ido_scale_menu_item_size_allocate (GtkWidget *widget, "horizontal-padding", &horizontal_padding, NULL); - primary_padding = GTK_WIDGET_VISIBLE (priv->primary_image) ? primary_image_req.width : 0; - secondary_padding = GTK_WIDGET_VISIBLE (priv->secondary_image) ? secondary_image_req.width : 0; + primary_padding = gtk_widget_get_visible (priv->primary_image) ? primary_image_req.width : 0; + secondary_padding = gtk_widget_get_visible (priv->secondary_image) ? secondary_image_req.width : 0; priv->left_padding = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ? primary_padding : secondary_padding; @@ -297,7 +297,7 @@ ido_scale_menu_item_expose (GtkWidget *widget, { IdoScaleMenuItemPrivate *priv = GET_PRIVATE (widget); - if (GTK_WIDGET_DRAWABLE (widget)) + if (gtk_widget_is_drawable (widget)) { GdkPixbuf *pixbuf = gtk_offscreen_window_get_pixbuf (GTK_OFFSCREEN_WINDOW (priv->offscreen)); |