diff options
author | James Booth <boothj5@gmail.com> | 2013-02-02 23:52:47 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-02-02 23:52:47 +0000 |
commit | 7d6ce4da0271babfce08d19899563b1065feedef (patch) | |
tree | 98ff71f45ba784ad771406eda1a777368e46a6ab | |
parent | 7100b0e361d4d87d32392b7a0b62e94a311a2f6e (diff) | |
download | profani-tty-7d6ce4da0271babfce08d19899563b1065feedef.tar.gz |
Added resize check to ui module
-rw-r--r-- | src/profanity.c | 11 | ||||
-rw-r--r-- | src/ui/ui.h | 3 | ||||
-rw-r--r-- | src/ui/windows.c | 7 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/profanity.c b/src/profanity.c index e53885c5..0dddac14 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -70,7 +70,6 @@ prof_run(const int disable_tls, char *log_level) size = 0; while(ch != '\n') { - if (jabber_get_connection_status() == JABBER_CONNECTED) { _handle_idle_time(); } @@ -78,24 +77,16 @@ prof_run(const int disable_tls, char *log_level) gdouble elapsed = g_timer_elapsed(timer, NULL); gint remind_period = prefs_get_notify_remind(); - - // 0 means to not remind if (remind_period > 0 && elapsed >= remind_period) { notify_remind(); g_timer_start(timer); } - ui_handle_special_keys(&ch); - - if (ch == KEY_RESIZE) { - ui_resize(ch, inp, size); - } - + ui_handle_special_keys(&ch, inp, size); ui_refresh(); jabber_process_events(); ch = inp_get_char(inp, &size); - if (ch != ERR) { ui_reset_idle_time(); } diff --git a/src/ui/ui.h b/src/ui/ui.h index d83b73f3..95e67269 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -75,7 +75,8 @@ void ui_contact_online(const char * const from, const char * const show, void ui_contact_offline(const char * const from, const char * const show, const char * const status); void ui_disconnected(void); -void ui_handle_special_keys(const wint_t * const ch); +void ui_handle_special_keys(const wint_t * const ch, const char * const inp, + const int size); void ui_switch_win(const int i); gboolean ui_windows_full(void); unsigned long ui_get_idle_time(void); diff --git a/src/ui/windows.c b/src/ui/windows.c index a868aa5f..84628a1e 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -508,10 +508,15 @@ ui_disconnected(void) } void -ui_handle_special_keys(const wint_t * const ch) +ui_handle_special_keys(const wint_t * const ch, const char * const inp, + const int size) { _win_handle_switch(ch); _win_handle_page(ch); + if (*ch == KEY_RESIZE) { + ui_resize(*ch, inp, size); + } + } void |