ref: 54953ac64e1fc14ca0ca4c4db26fd1adee8aa092
parent: d788822135fc09203b781588da4dfdf8a05e693b
author: Philip Silva <philip.silva@protonmail.com>
date: Sun Oct 3 07:44:35 EDT 2021
up- and downward compat
--- a/hidpi-1.patch
+++ b/hidpi-1.patch
@@ -101,10 +101,11 @@
char buf[128], info[NINFO+1], *t, isnew;
int n, datafd, ctlfd, reffd;
Display *disp;
-@@ -320,6 +321,18 @@
+@@ -319,6 +320,18 @@
+ if(dir!=nil && dir->qid.vers==1) /* other way to tell */
disp->_isnewdisplay = 1;
free(dir);
-
++
+ a = bufimage(disp, 3);
+ if(a == nil)
+ goto Error5;
@@ -112,11 +113,11 @@
+ a[1] = 1;
+ a[2] = 'd';
+ disp->dpi = 100;
-+ if(flushimage(disp, 0) < 0)
-+ goto Error5;
-+ if((read(datafd, info, sizeof info)) == 12)
-+ disp->dpi = atoi(info);
-+
++ if(flushimage(disp, 0) >= 0) {
++ if((read(datafd, info, sizeof info)) == 12)
++ disp->dpi = atoi(info);
++ }
+
return disp;
}
-
+