mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
devdraw: add forcedpi toggled by Fn+F3 on Mac
R=rsc http://codereview.appspot.com/6846104
This commit is contained in:
parent
2589c5c6ee
commit
55905845f3
4 changed files with 20 additions and 3 deletions
|
@ -399,8 +399,8 @@ initimg(void)
|
|||
return i;
|
||||
}
|
||||
|
||||
static void
|
||||
resizeimg()
|
||||
void
|
||||
resizeimg(void)
|
||||
{
|
||||
[win.img release];
|
||||
_drawreplacescreenimage(initimg());
|
||||
|
|
|
@ -367,6 +367,8 @@ abortcompose(void)
|
|||
keystroke(Kalt);
|
||||
}
|
||||
|
||||
void resizeimg(void);
|
||||
|
||||
void
|
||||
keystroke(int c)
|
||||
{
|
||||
|
@ -379,6 +381,16 @@ keystroke(int c)
|
|||
nk = 0;
|
||||
return;
|
||||
}
|
||||
if(c == KF+3) {
|
||||
if(forcedpi)
|
||||
forcedpi = 0;
|
||||
else if(displaydpi >= 200)
|
||||
forcedpi = 100;
|
||||
else
|
||||
forcedpi = 225;
|
||||
resizeimg();
|
||||
return;
|
||||
}
|
||||
if(!alting){
|
||||
kputc(c);
|
||||
return;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "devdraw.h"
|
||||
|
||||
extern void _flushmemscreen(Rectangle);
|
||||
int forcedpi = 0;
|
||||
int displaydpi = 100;
|
||||
|
||||
#define NHASH (1<<5)
|
||||
|
@ -1101,7 +1102,10 @@ _drawmsgwrite(void *v, int n)
|
|||
err = "unknown query";
|
||||
goto error;
|
||||
case 'd': /* dpi */
|
||||
fmtprint(&fmt, "%11d ", displaydpi);
|
||||
if(forcedpi)
|
||||
fmtprint(&fmt, "%11d ", forcedpi);
|
||||
else
|
||||
fmtprint(&fmt, "%11d ", displaydpi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,3 +7,4 @@ int mouseswap(int);
|
|||
void abortcompose(void);
|
||||
|
||||
extern int displaydpi;
|
||||
extern int forcedpi;
|
||||
|
|
Loading…
Reference in a new issue