From 61d48161028418fef70fe982804f744b7791093b Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 3 Dec 2017 06:27:18 +0100 Subject: [PATCH] screenlock: avoid continuous blanking, draw fullscreen over border --- sys/src/cmd/screenlock.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/src/cmd/screenlock.c b/sys/src/cmd/screenlock.c index c127c2193..cbf4b9b8f 100644 --- a/sys/src/cmd/screenlock.c +++ b/sys/src/cmd/screenlock.c @@ -80,7 +80,7 @@ blanker(void *) return; for(;;){ - if(((ulong)time(0) - (ulong)blank) >= 5){ + if(blank != 0 && ((ulong)time(0) - (ulong)blank) >= 5){ blank = 0; write(fd, "blank", 5); } @@ -128,8 +128,8 @@ lockscreen(void) buf[sizeof buf-1] = 0; if(tokenize(buf, flds, Nfld) != Nfld) sysfatal("can't tokenize /dev/screen header"); - snprint(newcmd, sizeof newcmd, "-r %s %s %d %d", - flds[1], flds[2], atoi(flds[3]), atoi(flds[4])); + snprint(newcmd, sizeof newcmd, "-r %s %s %s %s", + flds[1], flds[2], flds[3], flds[4]); newwindow(newcmd); if((fd = open("/dev/consctl", OWRITE)) >= 0) @@ -146,6 +146,7 @@ lockscreen(void) if(initdraw(nil, nil, "screenlock") < 0) sysfatal("initdraw failed"); + screen = _screen->image; /* fullscreen */ if((fd = open(pic, OREAD)) >= 0){ if((i = readimage(display, fd, 0)) != nil){