diff --git a/include/notcurses.h b/include/notcurses.h index 9a39a9c7b..a260aff87 100644 --- a/include/notcurses.h +++ b/include/notcurses.h @@ -714,6 +714,9 @@ API struct panelreel* panelreel_create(struct ncplane* nc, const panelreel_options* popts, int efd); +// Returns the ncplane on which this panelreel lives. +API struct ncplane* panelreel_plane(struct panelreel* pr); + // Tablet draw callback, provided a ncplane the first column that may be used, // the first row that may be used, the first column that may not be used, the // first row that may not be used, and a bool indicating whether output ought diff --git a/src/demo/panelreel.c b/src/demo/panelreel.c index 2a160b64b..3f2cd71c7 100644 --- a/src/demo/panelreel.c +++ b/src/demo/panelreel.c @@ -270,6 +270,12 @@ panelreel_demo_core(struct notcurses* nc, int efd, tabletctx** tctxs){ ncplane_cursor_move_yx(w, 1, 1); ncplane_printf(w, "a, b, c create tablets, DEL deletes, q quits."); // FIXME clrtoeol(); + /* + struct timespec fadets = { .tv_sec = 1, .tv_nsec = 0, }; + if(ncplane_fadein(panelreel_plane(pr), &fadets)){ + return NULL; + } + */ unsigned id = 0; do{ ncplane_styles_set(w, 0); diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 407b479f4..d9a9f19e7 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -942,8 +942,8 @@ term_setstyles(const notcurses* nc, FILE* out, uint32_t* curattr, const cell* c) // find the topmost cell for this coordinate static const cell* -visible_cell(const notcurses* nc, int y, int x, const ncplane** retp){ - const ncplane* p = nc->top; +visible_cell(int y, int x, ncplane** retp){ + ncplane* p = *retp; while(p){ // where in the plane this coordinate would be, based off absy/absx. the // true origin is 0,0, so abs=2,2 means coordinate 3,3 would be 1,1, while @@ -955,9 +955,22 @@ visible_cell(const notcurses* nc, int y, int x, const ncplane** retp){ if(poffx < p->lenx && poffx >= 0){ *retp = p; const cell* vis = &p->fb[fbcellidx(p, poffy, poffx)]; + // if we never actually loaded the cell, use the background, if one + // is defined. if(vis->gcluster == 0){ vis = &p->background; } + // if it's using the terminal default, chase further down + // FIXME should probably be based off alpha channel + if(cell_fg_default_p(vis) && cell_bg_default_p(vis) && vis->gcluster == 0){ + *retp = p->z; + const cell* trans = visible_cell(y, x, retp); + if(trans){ + vis = trans; + }else{ + *retp = p; + } + } return vis; } } @@ -1092,8 +1105,8 @@ int notcurses_render(notcurses* nc){ // surprise enlargenings, otherwise we just print forward for(x = 0 ; x < nc->stdscr->lenx ; ++x){ unsigned r, g, b, br, bg, bb; - const ncplane* p; - const cell* c = visible_cell(nc, y, x, &p); + ncplane* p = nc->top; + const cell* c = visible_cell(y, x, &p); // we allow these to be set distinctly, but terminfo only supports using // them both via the 'op' capability. unless we want to generate the 'op' // escapes ourselves, if either is set to default, we first send op, and diff --git a/src/lib/panelreel.c b/src/lib/panelreel.c index cffcf9188..b0c311d4c 100644 --- a/src/lib/panelreel.c +++ b/src/lib/panelreel.c @@ -550,6 +550,10 @@ validate_panelreel_opts(ncplane* w, const panelreel_options* popts){ return true; } +ncplane* panelreel_plane(panelreel* pr){ + return pr->p; +} + panelreel* panelreel_create(ncplane* w, const panelreel_options* popts, int efd){ panelreel* pr; diff --git a/src/view/view.cpp b/src/view/view.cpp index d424b53f2..ca986213b 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -79,6 +79,10 @@ int main(int argc, char** argv){ std::cerr << "Error decoding " << argv[i] << ": " << errbuf.data() << std::endl; return EXIT_FAILURE; } + ncspecial_key special; + cell c = CELL_TRIVIAL_INITIALIZER; + notcurses_getc_blocking(nc, &c, &special); + cell_release(ncp, &c); ncvisual_destroy(ncv); } if(notcurses_stop(nc)){ diff --git a/tests/profoundchangesbeautiful-bare.jpg b/tests/profoundchangesbeautiful-bare.jpg new file mode 100644 index 000000000..3edf080dd Binary files /dev/null and b/tests/profoundchangesbeautiful-bare.jpg differ