screenlock: avoid continuous blanking, draw fullscreen over border

This commit is contained in:
cinap_lenrek 2017-12-03 06:27:18 +01:00
parent e1c447bc11
commit 61d4816102

View file

@ -80,7 +80,7 @@ blanker(void *)
return; return;
for(;;){ for(;;){
if(((ulong)time(0) - (ulong)blank) >= 5){ if(blank != 0 && ((ulong)time(0) - (ulong)blank) >= 5){
blank = 0; blank = 0;
write(fd, "blank", 5); write(fd, "blank", 5);
} }
@ -128,8 +128,8 @@ lockscreen(void)
buf[sizeof buf-1] = 0; buf[sizeof buf-1] = 0;
if(tokenize(buf, flds, Nfld) != Nfld) if(tokenize(buf, flds, Nfld) != Nfld)
sysfatal("can't tokenize /dev/screen header"); sysfatal("can't tokenize /dev/screen header");
snprint(newcmd, sizeof newcmd, "-r %s %s %d %d", snprint(newcmd, sizeof newcmd, "-r %s %s %s %s",
flds[1], flds[2], atoi(flds[3]), atoi(flds[4])); flds[1], flds[2], flds[3], flds[4]);
newwindow(newcmd); newwindow(newcmd);
if((fd = open("/dev/consctl", OWRITE)) >= 0) if((fd = open("/dev/consctl", OWRITE)) >= 0)
@ -146,6 +146,7 @@ lockscreen(void)
if(initdraw(nil, nil, "screenlock") < 0) if(initdraw(nil, nil, "screenlock") < 0)
sysfatal("initdraw failed"); sysfatal("initdraw failed");
screen = _screen->image; /* fullscreen */
if((fd = open(pic, OREAD)) >= 0){ if((fd = open(pic, OREAD)) >= 0){
if((i = readimage(display, fd, 0)) != nil){ if((i = readimage(display, fd, 0)) != nil){