mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 09:39:03 -04:00
don't allow 0 in ioctl to clear earlier CSI14t response #2000
This commit is contained in:
parent
56636ca57c
commit
aeadc7e499
@ -266,9 +266,14 @@ int update_term_dimensions(int fd, int* rows, int* cols, tinfo* tcache,
|
||||
if(tcache->linux_fb_fd >= 0){
|
||||
get_linux_fb_pixelgeom(tcache, &tcache->pixy, &tcache->pixx);
|
||||
}else{
|
||||
// we might have the pixel geometry from CSI14t, so don't override a
|
||||
// valid earlier response with 0s from the ioctl. we do want to fire
|
||||
// off a fresh CSI14t in this case, though FIXME.
|
||||
if(ws.ws_ypixel){
|
||||
tcache->pixy = ws.ws_ypixel;
|
||||
tcache->pixx = ws.ws_xpixel;
|
||||
}
|
||||
}
|
||||
tcache->cellpixy = ws.ws_row ? tcache->pixy / ws.ws_row : 0;
|
||||
tcache->cellpixx = ws.ws_col ? tcache->pixx / ws.ws_col : 0;
|
||||
if(tcache->cellpixy == 0 || tcache->cellpixx == 0){
|
||||
|
Loading…
x
Reference in New Issue
Block a user