diff options
-rw-r--r-- | src/ui/core.c | 13 | ||||
-rw-r--r-- | src/ui/window.c | 2 | ||||
-rw-r--r-- | src/ui/window.h | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index ab06149e..4a8a984f 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -298,7 +298,11 @@ _ui_incoming_msg(const char * const from, const char * const message, free(display_from); - ui_current_page_off(); + ProfWin *current = wins_get_current(); + if (!current->paged) { + win_move_to_end(current); + win_refresh(current); + } } static void @@ -858,7 +862,7 @@ static void _ui_current_page_off(void) { ProfWin *current = wins_get_current(); - win_page_off(current); + win_move_to_end(current); win_refresh(current); } @@ -1663,6 +1667,11 @@ _win_handle_page(const wint_t * const ch) current->paged = 1; wins_refresh_current(); } + + // switch off page if last line visible + if ((y-1) - *page_start == page_space) { + current->paged = 0; + } } static void diff --git a/src/ui/window.c b/src/ui/window.c index 320566fd..95870847 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -114,7 +114,7 @@ win_refresh(ProfWin *window) } void -win_page_off(ProfWin *window) +win_move_to_end(ProfWin *window) { window->paged = 0; diff --git a/src/ui/window.h b/src/ui/window.h index 940c34fd..4c35c2ee 100644 --- a/src/ui/window.h +++ b/src/ui/window.h @@ -63,7 +63,7 @@ void win_vprint_line(ProfWin *self, const char show_char, int attrs, void win_print_line(ProfWin *self, const char show_char, int attrs, const char * const msg); void win_refresh(ProfWin *window); -void win_page_off(ProfWin *window); +void win_move_to_end(ProfWin *window); void win_print_time(ProfWin *window, char show_char); void win_presence_colour_on(ProfWin *window, const char * const presence); void win_presence_colour_off(ProfWin *window, const char * const presence); |