diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-02-02 02:28:55 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2006-02-02 02:28:55 +0000 |
commit | 0fea22120d49a888e34fe24483a36e7c3d8502a9 (patch) | |
tree | 94cba6f9aba5ffc43417de89b23682e299e9a215 /src/mainwindow.c | |
parent | dfe3a16ff4cc92ff2160b1e2118de1d6222f0480 (diff) |
fixed key event handling of the quick search entry.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@959 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/mainwindow.c')
-rw-r--r-- | src/mainwindow.c | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c index f5dd192f..fd9694a8 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -2689,39 +2689,16 @@ static gboolean main_window_key_pressed(GtkWidget *widget, GdkEventKey *event, if (!mainwin) return FALSE; - if (GTK_WIDGET_HAS_FOCUS(mainwin->summaryview->search_entry)) { - /* g_print("keyval: %d, state: %d\n", - event->keyval, event->state); */ - if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) - return FALSE; - - if (gtk_accel_group_query(mainwin->menu_factory->accel_group, - event->keyval, - event->state & ~GDK_LOCK_MASK, - NULL) != NULL) { - gunichar ch; - - ch = gdk_keyval_to_unicode(event->keyval); - if (ch != 0) { - gchar str[7]; - gint len; - gint pos; - GtkEditable *editable; - - editable = GTK_EDITABLE - (mainwin->summaryview->search_entry); - len = g_unichar_to_utf8(ch, str); - gtk_editable_delete_selection(editable); - pos = gtk_editable_get_position(editable); - gtk_editable_insert_text - (editable, str, len, &pos); - gtk_editable_set_position(editable, pos); - return TRUE; - } - } - } + if (!GTK_WIDGET_HAS_FOCUS(mainwin->summaryview->search_entry)) + return FALSE; - return FALSE; + /* g_print("keyval: %d, state: %d\n", event->keyval, event->state); */ + if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) + return FALSE; + + gtk_window_propagate_key_event(GTK_WINDOW(widget), event); + + return TRUE; } static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event, |