diff --git a/sounds/ToxicError.wav b/sounds/ToxicError.wav index 2361038..25086a2 100644 Binary files a/sounds/ToxicError.wav and b/sounds/ToxicError.wav differ diff --git a/src/global_commands.c b/src/global_commands.c index 96a2d17..aa5c884 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -262,9 +262,7 @@ void cmd_avatar(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[ void cmd_clear(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) { line_info_clear(self->chatwin->hst); - wclear(window); - endwin(); - refresh(); + force_refresh(window); } void cmd_connect(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MAX_STR_SIZE]) diff --git a/src/input.c b/src/input.c index 4fd2b72..b037f74 100644 --- a/src/input.c +++ b/src/input.c @@ -236,6 +236,10 @@ bool input_handle(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_y) input_history(self, key, mx_x); break; + case T_KEY_C_L: + force_refresh(self->chatwin->history); + break; + default: match = false; break; diff --git a/src/toxic.h b/src/toxic.h index 4b12214..6f1898f 100644 --- a/src/toxic.h +++ b/src/toxic.h @@ -62,6 +62,7 @@ #define T_KEY_C_F 0x06 /* ctrl-f */ #define T_KEY_C_H 0x08 /* ctrl-h */ #define T_KEY_C_Y 0x19 /* ctrl-y */ +#define T_KEY_C_L 0x0C /* ctrl-l */ #define T_KEY_TAB 0x09 /* TAB key */ #define ONLINE_CHAR "*" diff --git a/src/windows.c b/src/windows.c index c981efa..bf29fd0 100644 --- a/src/windows.c +++ b/src/windows.c @@ -496,6 +496,13 @@ ToxWindow *get_window_ptr(int i) return toxwin; } +void force_refresh(WINDOW *w) +{ + wclear(w); + endwin(); + refresh(); +} + int get_num_active_windows(void) { return num_active_windows; diff --git a/src/windows.h b/src/windows.h index de63a80..c99f6d7 100644 --- a/src/windows.h +++ b/src/windows.h @@ -242,6 +242,7 @@ void set_active_window(int ch); int get_num_active_windows(void); void kill_all_windows(Tox *m); /* should only be called on shutdown */ void on_window_resize(void); +void force_refresh(WINDOW *w); ToxWindow *get_window_ptr(int i); /* refresh inactive windows to prevent scrolling bugs.