From: Michael Stapelberg Date: Mon, 9 Mar 2009 17:20:15 +0000 (+0100) Subject: Make i3lock fork(), use white color and disable DPMS X-Git-Tag: 3.a~45 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3f482bd3b35e33194954dbcde37645c981881a34;p=i3%2Fi3 Make i3lock fork(), use white color and disable DPMS The idea of fork()ing is to allow for aliases which first lock the screen, then suspend. White color and no DPMS is better than black color because you can tell the difference between your notebook failed to suspend and it being locked. --- diff --git a/i3lock/slock.c b/i3lock/slock.c index 6f2e8afe..acc0db70 100644 --- a/i3lock/slock.c +++ b/i3lock/slock.c @@ -15,7 +15,6 @@ #include #include #include -#include #if HAVE_BSD_AUTH #include @@ -94,9 +93,12 @@ main(int argc, char **argv) { screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); + if (fork() != 0) + return 0; + /* init */ wa.override_redirect = 1; - wa.background_pixel = BlackPixel(dpy, screen); + wa.background_pixel = WhitePixel(dpy, screen); w = XCreateWindow(dpy, root, 0, 0, DisplayWidth(dpy, screen), DisplayHeight(dpy, screen), 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixel, &wa); @@ -125,10 +127,6 @@ main(int argc, char **argv) { /* main event loop */ while(running && !XNextEvent(dpy, &ev)) { - if(len == 0 && DPMSCapable(dpy)) { - DPMSEnable(dpy); - DPMSForceLevel(dpy, DPMSModeOff); - } if(ev.type == KeyPress) { buf[0] = 0; num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0);