From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 14624 invoked from network); 19 Jul 2021 09:10:20 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 19 Jul 2021 09:10:20 -0000 Received: from mail-ed1-f44.google.com ([209.85.208.44]) by 1ess; Sun Jul 18 12:04:56 -0400 2021 Received: by mail-ed1-f44.google.com with SMTP id l26so20121394eda.10 for <9front@9front.org>; Sun, 18 Jul 2021 09:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=n0aHOqX+IvNynInMhJfVaOq7MNKdDAPxsi5nZdpCsFU=; b=Swco4nCrflvUGF3nUA4mRZY/6wZeQBYRu9qU5j2rRuTw8rGHAUiEVgkKsu3mWO4lq3 wlViOVmkwfnAp/yLhnjvsK5Ra9OObT9Qh9+BTgIabTyVVCHai+WnTpRsNf/97Dwwa4fy FVGlUhfRGgFX91ZV6pWKAJK11J2ATt/kXucrfdgVLzOMiGMOQcebtEyI9T1NOqXILdRo Ie7vniDJXQdcqNYXGSens/ZQ4Gu+OOQplKDCNFEtwD/16NkYCTzw0xf7iJIIUMtSYxHH gkczJrcphRnMghexnyIvGuPOEu1wqEr6+xiMZSJYH6qjQWyPRokZCFJhccrC5i84VRyw 3XhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=n0aHOqX+IvNynInMhJfVaOq7MNKdDAPxsi5nZdpCsFU=; b=irt883I7T/9ZKDuw+XoYePdQ8EPgeekYiMBGOYPD29ZxdgiBepW2eN1OyS6PVMuH0P 76GdeXU0TNq+81gBliKULKkolXVHVhqvflzWCMHPgWvS7lYWIrvukF28lrLUwPjzBuv2 DUAvv6gszC4HfrV77f68meunoXqHSMHvF3xemQEgHQXPn40peyAGtK2U0CY/bHfVqshI EvP3moSdYW9yW1md5OvKaiCWvMNVMnmHvZeGRe836YKFScfb+zS4S4h1LT7Ig9P2vmkp QN2CVld3uI33FD0C9mVhLBphgsfi66OSMrUQSPFSHv2wRtmZ8kiz2nlkS5aW/0tfFlMx p7Qg== X-Gm-Message-State: AOAM532Md0/nq+MY1VmfvE2o3Qm5q76uYUHFWl4T0qO3ssEwZrI4AMPL EE/M7xPbAvlx0k+R8/aymKTOvUtwuVAL23vF/aoJa+QJxeA= X-Google-Smtp-Source: ABdhPJxlKhbdwP0S4jmUOHnjbXGe21+qWOqyIJqt76x5Y/auEc/TuTLbLq8J7/udzET4aooTbwd/6ZsMDXenWR9pVgA= X-Received: by 2002:a05:6402:1347:: with SMTP id y7mr29629656edw.87.1626624288964; Sun, 18 Jul 2021 09:04:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:906:76c8:b029:4d9:7711:78cc with HTTP; Sun, 18 Jul 2021 09:04:48 -0700 (PDT) From: Stuart Morrow Date: Sun, 18 Jul 2021 17:04:48 +0100 Message-ID: To: 9front@9front.org Content-Type: text/plain; charset="UTF-8" List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: extended wrapper HTTP over WEB2.0 STM-aware grid Subject: [9front] screenlock Reply-To: 9front@9front.org Precedence: bulk Would like to get this in before release as it all-but-fixes the horrible visual bug of the green border. String becomes stringbg so we have guaranteed max contrast in case the user changes the picture. (If you don't change the picture, it's white-on-black-on-black (sic) and you would never notice the change.) (Still puzzled and bothered by the getwindow'ing version.) --- /mnt/git/object/be36c092ac061a04065720e98e5849130487be7f/tree/sys/src/cmd/screenlock.c +++ sys/src/cmd/screenlock.c @@ -119,14 +119,17 @@ void top(void*) { - int fd; + int fd, n; + char buf[128]; - if((fd = open("/dev/wctl", OWRITE)) < 0) + if((fd = open("/dev/wctl", ORDWR)) < 0) return; for(;;){ - write(fd, "current", 7); - sleep(500); + n = read(fd, buf, sizeof buf); + if(n > 48) + if(strstr(buf+48, "notcurrent")) + write(fd, "current", 7); } } @@ -186,7 +189,7 @@ tm = localtime(time(&blank)); s = smprint("user %s at %d:%02.2d", getuser(), tm->hour, tm->min); p = subpt(p, Pt(stringwidth(font, "m") * strlen(s) / 2, 0)); - string(screen, p, screen->display->white, ZP, font, s); + stringbg(screen, p, display->white, ZP, font, s, display->black, ZP); } flushimage(display, 1);