From f8a4312fdd1f28eb468e9b61804e3c3740b7dec1 Mon Sep 17 00:00:00 2001 From: Grayson MacKenzie Date: Sun, 30 Mar 2014 16:42:27 -0400 Subject: [PATCH] Repaired window switching after widechar fix --- src/windows.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/windows.c b/src/windows.c index e6d6dea..ce29fb6 100644 --- a/src/windows.c +++ b/src/windows.c @@ -397,12 +397,14 @@ void draw_active_window(Tox *m) bool ltr; #ifdef HAVE_WIDECHAR int status = wget_wch(stdscr, &ch); - if (status == OK) - ltr = true; - else if (status == KEY_CODE_YES) - ltr = false; - else + + if (status == ERR) return; + + if (status == OK) + ltr = iswprint(ch); + else /* if (status == KEY_CODE_YES) */ + ltr = false; #else ch = getch(); @@ -413,7 +415,7 @@ void draw_active_window(Tox *m) ltr = isprint(ch); #endif - if (ltr && (ch == T_KEY_NEXT || ch == T_KEY_PREV) ) { + if (!ltr && (ch == T_KEY_NEXT || ch == T_KEY_PREV) ) { set_next_window((int) ch); } else { pthread_mutex_lock(&Winthread.lock);