shithub: misc

ref: 06ded18ce9088df6aa259598454f804df3f44ff3
dir: /hidpi-2.patch/

View raw version
diff c7dcc82b0be805717efbe77c98eaadf3ee1e31af uncommitted
--- a/sys/man/8/plan9.ini
+++ b/sys/man/8/plan9.ini
@@ -971,6 +971,8 @@
 .BR off .
 The first two specify differing levels of power saving;
 the third turns the monitor off completely.
+.SS \fL*dpi=\fIvalue\fP
+This is used to specify the screen dpi.
 .SS NVRAM
 .SS \fLnvram=\fIfile\fP
 .SS \fLnvrlen=\fIlength\fP
--- a/sys/src/9/port/devdraw.c
+++ b/sys/src/9/port/devdraw.c
@@ -765,6 +765,7 @@
 drawnewclient(void)
 {
 	Client *cl, **cp;
+	char *p;
 	int i;
 
 	for(i=0; i<sdraw.nclient; i++){
@@ -789,7 +790,9 @@
 	cl->slot = i;
 	cl->clientid = ++sdraw.clientid;
 	cl->op = SoverD;
-	cl->displaydpi=100;
+	if((p = getconf("dpi")) == nil || (cl->displaydpi = atoi(p)) == 0){
+		cl->displaydpi=100;
+	}
 	sdraw.client[i] = cl;
 	return cl;
 }