[termdesc] use RGB from XTGETTCAP to set capability

pull/2331/head
nick black 3 years ago
parent 0f5aec510a
commit f4f1d74dd1
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -1246,6 +1246,8 @@ tcap_cb(inputctx* ictx){
} }
} }
}else if(strncasecmp(s, "524742=", 7) == 0){ }else if(strncasecmp(s, "524742=", 7) == 0){
loginfo("got rgb (%s)\n", s);
ictx->initdata->rgb = true;
}else{ }else{
logdebug("unknown capability=val %s\n", str); logdebug("unknown capability=val %s\n", str);
} }

@ -62,6 +62,7 @@ struct initial_responses {
unsigned kitty_graphics; // kitty graphics supported unsigned kitty_graphics; // kitty graphics supported
uint32_t bg; // default background uint32_t bg; // default background
bool got_bg; // have we read default background? bool got_bg; // have we read default background?
bool rgb; // was RGB DirectColor advertised?
int pixx; // screen geometry in pixels int pixx; // screen geometry in pixels
int pixy; // screen geometry in pixels int pixy; // screen geometry in pixels
int dimx; // screen geometry in cells int dimx; // screen geometry in cells

@ -95,8 +95,8 @@ notcurses_stop_minimal(void* vnc){
ret = -1; ret = -1;
} }
fbuf_reset(f); fbuf_reset(f);
ret |= mouse_setup(&nc->tcache, NCMICE_NO_EVENTS);
if(nc->tcache.ttyfd >= 0){ if(nc->tcache.ttyfd >= 0){
ret |= notcurses_mice_disable(nc);
if(nc->tcache.tpreserved){ if(nc->tcache.tpreserved){
ret |= tcsetattr(nc->tcache.ttyfd, TCSAFLUSH, nc->tcache.tpreserved); ret |= tcsetattr(nc->tcache.ttyfd, TCSAFLUSH, nc->tcache.tpreserved);
} }

@ -1044,6 +1044,9 @@ int interrogate_terminfo(tinfo* ti, FILE* out, unsigned utf8,
ti->dimy = iresp->dimy; ti->dimy = iresp->dimy;
ti->dimx = iresp->dimx; ti->dimx = iresp->dimx;
} }
if(iresp->rgb){
ti->caps.rgb = true;
}
if(iresp->pixy && iresp->pixx){ if(iresp->pixy && iresp->pixx){
ti->pixy = iresp->pixy; ti->pixy = iresp->pixy;
ti->pixx = iresp->pixx; ti->pixx = iresp->pixx;

Loading…
Cancel
Save