aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2017-01-06 10:35:12 -0500
committerRuss Cox <rsc@swtch.com>2017-01-06 15:36:59 +0000
commitd296c18e379547218c4c50445c56e725ec3be91d (patch)
treee49c0a03b4ad07a9638c6df3a30a25edeee2a0a2 /src/cmd/9term
parent657f699ef7e5a91a529337cac76ed48c68a28583 (diff)
downloadplan9port-d296c18e379547218c4c50445c56e725ec3be91d.tar.gz
plan9port-d296c18e379547218c4c50445c56e725ec3be91d.tar.bz2
plan9port-d296c18e379547218c4c50445c56e725ec3be91d.zip
9term, mc: conspire to handle hidpi displays
9term now uses the low bit of ws.ws_ypixel to signal whether this is a hidpi display, and mc adjusts the font it uses for columnation accordingly. Makes 'lc' work right on hidpi displays. Change-Id: I52928871ffb7f4c6fd6722f3d59f1836379148c6 Reviewed-on: https://plan9port-review.googlesource.com/2760 Reviewed-by: Russ Cox <rsc@swtch.com>
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/bsdpty.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/9term/bsdpty.c b/src/cmd/9term/bsdpty.c
index 4836d24d..fe0367f0 100644
--- a/src/cmd/9term/bsdpty.c
+++ b/src/cmd/9term/bsdpty.c
@@ -11,6 +11,7 @@
#endif
#include <fcntl.h>
#include <libc.h>
+#include <draw.h>
#include "term.h"
#define debug 0
@@ -75,7 +76,14 @@ updatewinsize(int row, int col, int dx, int dy)
ws.ws_row = row;
ws.ws_col = col;
ws.ws_xpixel = dx;
+
+
+ // Leave "is this a hidpi display" in the low bit of the ypixel height for mc.
+ dy &= ~1;
+ if(display->dpi >= DefaultDPI*3/2)
+ dy |= 1;
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");