[render] call notcurses_refresh() on sigcont #281

This commit is contained in:
nick black 2021-11-17 03:14:34 -05:00
parent c707e49bd3
commit b91f150e96
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,8 @@ rearrangements of Notcurses.
lengths rather than closing coordinates, observing the same semantics as
outlined above.
* `ncplayer` now defaults to pixel blitting.
* `NCKEY_SIGNAL` is no longer a synonym for `NCKEY_RESIZE`, but instead
indicates receipt of `SIGCONT`.
* 2.4.9 (2021-11-11)
* Added `ncnmetric()`, which uses `snprintf()` internally. `ncmetric()`

View File

@ -3,6 +3,7 @@
#include <unistd.h>
#include "automaton.h"
#include "internal.h"
#include "render.h"
#include "in.h"
// Notcurses takes over stdin, and if it is not connected to a terminal, also
@ -34,6 +35,7 @@ void sigwinch_handler(int signo){
resize_seen = signo;
}else if(signo == SIGCONT){
cont_seen = signo;
sigcont_seen_for_render = 1;
}
}

View File

@ -4,6 +4,8 @@
#include <notcurses/direct.h>
#include "internal.h"
sig_atomic_t sigcont_seen_for_render = 0;
// update for a new visual area of |rows|x|cols|, neither of which may be zero.
// copies that area of the lastframe (damage map) which is shared between the
// two. new areas are initialized to empty, just like a new plane. lost areas
@ -1477,6 +1479,10 @@ ncpile_render_internal(ncplane* n, struct crender* rvec, int leny, int lenx){
}
int ncpile_rasterize(ncplane* n){
if(sigcont_seen_for_render){
sigcont_seen_for_render = 0;
notcurses_refresh(ncplane_notcurses(n), NULL, NULL);
}
struct timespec start, rasterdone, writedone;
clock_gettime(CLOCK_MONOTONIC, &start);
ncpile* pile = ncplane_pile(n);