# HG changeset patch # User Yoshiki Yazawa # Date 1197996249 -32400 # Node ID b03055a1437a13562b925246ed987bb7561d2581 # Parent 4d4691fdebe16d69b4c8419cd02eb4b82e27cbf0 make search and select dialog accept "fix" key press in input method context. diff -r 4d4691fdebe1 -r b03055a1437a src/audacious/ui_playlist.c --- a/src/audacious/ui_playlist.c Mon Dec 17 22:02:52 2007 +0900 +++ b/src/audacious/ui_playlist.c Wed Dec 19 01:44:09 2007 +0900 @@ -23,6 +23,8 @@ * Audacious or using our public API to be a derived work. */ +/* #define AUD_DEBUG 1 */ + #include "ui_playlist.h" #include @@ -570,14 +572,23 @@ /* create a TitleInput tuple with user search data */ Tuple *tuple = tuple_new(); gchar *searchdata = NULL; + searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_title) ); + AUDDBG("title=\"%s\"\n", searchdata); tuple_associate_string(tuple, FIELD_TITLE, NULL, searchdata); + searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_album) ); + AUDDBG("album=\"%s\"\n", searchdata); tuple_associate_string(tuple, FIELD_ALBUM, NULL, searchdata); + searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_performer) ); + AUDDBG("performer=\"%s\"\n", searchdata); tuple_associate_string(tuple, FIELD_ARTIST, NULL, searchdata); + searchdata = (gchar*)gtk_entry_get_text( GTK_ENTRY(searchdlg_entry_file_name) ); + AUDDBG("filename=\"%s\"\n", searchdata); tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, searchdata); + /* check if previous selection should be cleared before searching */ if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(searchdlg_checkbt_clearprevsel)) == TRUE ) playlistwin_select_none(); @@ -1927,8 +1938,13 @@ switch (event->keyval) { case GDK_Return: - gtk_dialog_response(GTK_DIALOG(searchdlg_win), GTK_RESPONSE_ACCEPT); - return TRUE; + if (gtk_im_context_filter_keypress (GTK_ENTRY (entry)->im_context, event)) { + GTK_ENTRY (entry)->need_im_reset = TRUE; + return TRUE; + } else { + gtk_dialog_response(GTK_DIALOG(searchdlg_win), GTK_RESPONSE_ACCEPT); + return TRUE; + } default: return FALSE; }