diff options
Diffstat (limited to 'src/cmd/9term')
-rw-r--r-- | src/cmd/9term/9term.c | 8 | ||||
-rw-r--r-- | src/cmd/9term/bsdpty.c | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index 46a852bd..c2bd7766 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -174,15 +174,17 @@ resizethread(void *v) USED(v); - while(recv(mousectl->resizec, nil) == 1){ - if(getwindow(display, Refnone) < 0) - sysfatal("can't reattach to window"); + for(;;){ p = stringsize(display->defaultfont, "0"); if(p.x && p.y) updatewinsize(Dy(screen->r)/p.y, (Dx(screen->r)-Scrollwid-2)/p.x, Dx(screen->r), Dy(screen->r)); wresize(w, screen, 0); flushimage(display, 1); + if(recv(mousectl->resizec, nil) != 1) + break; + if(getwindow(display, Refnone) < 0) + sysfatal("can't reattach to window"); } } diff --git a/src/cmd/9term/bsdpty.c b/src/cmd/9term/bsdpty.c index 915836a8..52b9bb8a 100644 --- a/src/cmd/9term/bsdpty.c +++ b/src/cmd/9term/bsdpty.c @@ -76,9 +76,10 @@ updatewinsize(int row, int col, int dx, int dy) ws.ws_col = col; ws.ws_xpixel = dx; ws.ws_ypixel = dy; - if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col) - if(ioctl(rcfd, TIOCSWINSZ, &ws) < 0) - fprint(2, "ioctl: %r\n"); + if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col){ + if(ioctl(rcfd, TIOCSWINSZ, &ws) < 0) + fprint(2, "ioctl: %r\n"); + } ows = ws; } |