1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-25 13:03:02 +01:00

make ctrl-L force refresh the window

This commit is contained in:
Jfreegman 2014-10-01 16:24:36 -04:00
parent b46a77f977
commit e7697b8fba
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
6 changed files with 14 additions and 3 deletions

Binary file not shown.

View File

@ -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])

View File

@ -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;

View File

@ -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 "*"

View File

@ -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;

View File

@ -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.