diff options
author | toni <matzeton@googlemail.com> | 2015-11-17 18:45:43 +0100 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2015-11-17 22:47:16 +0100 |
commit | a3d1a3011a74cb9dca2a15edf47f766b69ff4331 (patch) | |
tree | 9ca4e05f380655564b17329424c83ffb36989dd0 /src/ui_elements.c | |
parent | 52a0dc4e34889317f4fec73a0a2f4069efa69ace (diff) |
replaced obsolete gettimeofday with clock_gettime
(pthread_conf_timedwait)
Diffstat (limited to 'src/ui_elements.c')
-rw-r--r-- | src/ui_elements.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/ui_elements.c b/src/ui_elements.c index 9f4994d..535bc0c 100644 --- a/src/ui_elements.c +++ b/src/ui_elements.c @@ -66,7 +66,7 @@ passwd_input_cb(WINDOW *wnd, void *data, int key) char ipc_buf[IPC_MQSIZ+1]; memset(ipc_buf, '\0', IPC_MQSIZ+1); - wtimeout(stdscr, -1); +// wtimeout(stdscr, -1); switch (key) { case UIKEY_ENTER: ui_ipc_msgsend(MQ_PW, a->input); @@ -84,6 +84,7 @@ passwd_input_cb(WINDOW *wnd, void *data, int key) set_txtwindow_text(infownd, ipc_buf); set_txtwindow_active(infownd, true); ui_thrd_resume(); + ui_thrd_force_update(); sleep(2); ui_ipc_msgrecv(MQ_IF, ipc_buf); @@ -101,14 +102,22 @@ passwd_input_cb(WINDOW *wnd, void *data, int key) activate_input(pw_input); ui_thrd_resume(); - //ui_thrd_force_update(); ui_ipc_sempost(SEM_IN); break; case UIKEY_BACKSPACE: del_input(wnd, a); - //ui_thrd_force_update(); break; case UIKEY_ESC: + wtimeout(stdscr, 0); + ui_thrd_suspend(); + deactivate_input(pw_input); + set_txtwindow_active(infownd, true); + set_txtwindow_color(infownd, COLOR_PAIR(5), COLOR_PAIR(5)); + set_txtwindow_title(infownd, "BUSY"); + set_txtwindow_text(infownd, "bye bye"); + ui_thrd_resume(); + ui_thrd_force_update(); + sleep(2); return DOUI_ERR; case UIKEY_DOWN: case UIKEY_UP: @@ -119,9 +128,9 @@ passwd_input_cb(WINDOW *wnd, void *data, int key) break; default: add_input(wnd, a, key); - //ui_thrd_force_update(); } - wtimeout(stdscr, 1000); +// wtimeout(stdscr, 1000); + refresh(); return DOUI_OK; } |