mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
[termdesc] use RGB from XTGETTCAP to set capability
This commit is contained in:
parent
0f5aec510a
commit
f4f1d74dd1
@ -1246,6 +1246,8 @@ tcap_cb(inputctx* ictx){
|
||||
}
|
||||
}
|
||||
}else if(strncasecmp(s, "524742=", 7) == 0){
|
||||
loginfo("got rgb (%s)\n", s);
|
||||
ictx->initdata->rgb = true;
|
||||
}else{
|
||||
logdebug("unknown capability=val %s\n", str);
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ struct initial_responses {
|
||||
unsigned kitty_graphics; // kitty graphics supported
|
||||
uint32_t bg; // default background
|
||||
bool got_bg; // have we read default background?
|
||||
bool rgb; // was RGB DirectColor advertised?
|
||||
int pixx; // screen geometry in pixels
|
||||
int pixy; // screen geometry in pixels
|
||||
int dimx; // screen geometry in cells
|
||||
|
@ -95,8 +95,8 @@ notcurses_stop_minimal(void* vnc){
|
||||
ret = -1;
|
||||
}
|
||||
fbuf_reset(f);
|
||||
ret |= mouse_setup(&nc->tcache, NCMICE_NO_EVENTS);
|
||||
if(nc->tcache.ttyfd >= 0){
|
||||
ret |= notcurses_mice_disable(nc);
|
||||
if(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->dimx = iresp->dimx;
|
||||
}
|
||||
if(iresp->rgb){
|
||||
ti->caps.rgb = true;
|
||||
}
|
||||
if(iresp->pixy && iresp->pixx){
|
||||
ti->pixy = iresp->pixy;
|
||||
ti->pixx = iresp->pixx;
|
||||
|
Loading…
Reference in New Issue
Block a user