|
|
@ -26,7 +26,7 @@ |
|
|
|
enum { |
|
|
|
enum { |
|
|
|
INIT, |
|
|
|
INIT, |
|
|
|
INPUT, |
|
|
|
INPUT, |
|
|
|
EMPTY, |
|
|
|
FAILED, |
|
|
|
NUMCOLS |
|
|
|
NUMCOLS |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -42,6 +42,7 @@ typedef struct { |
|
|
|
static Lock **locks; |
|
|
|
static Lock **locks; |
|
|
|
static int nscreens; |
|
|
|
static int nscreens; |
|
|
|
static Bool running = True; |
|
|
|
static Bool running = True; |
|
|
|
|
|
|
|
static Bool failure = False; |
|
|
|
static Bool rr; |
|
|
|
static Bool rr; |
|
|
|
static int rrevbase; |
|
|
|
static int rrevbase; |
|
|
|
static int rrerrbase; |
|
|
|
static int rrerrbase; |
|
|
@ -153,8 +154,10 @@ readpw(Display *dpy, const char *pws) |
|
|
|
#else |
|
|
|
#else |
|
|
|
running = !!strcmp(crypt(passwd, pws), pws); |
|
|
|
running = !!strcmp(crypt(passwd, pws), pws); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
if (running) |
|
|
|
if (running) { |
|
|
|
XBell(dpy, 100); |
|
|
|
XBell(dpy, 100); |
|
|
|
|
|
|
|
failure = True; |
|
|
|
|
|
|
|
} |
|
|
|
len = 0; |
|
|
|
len = 0; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case XK_Escape: |
|
|
|
case XK_Escape: |
|
|
@ -178,7 +181,7 @@ readpw(Display *dpy, const char *pws) |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (llen != 0 && len == 0) { |
|
|
|
} else if (llen != 0 && len == 0) { |
|
|
|
for (screen = 0; screen < nscreens; screen++) { |
|
|
|
for (screen = 0; screen < nscreens; screen++) { |
|
|
|
XSetWindowBackground(dpy, locks[screen]->win, locks[screen]->colors[EMPTY]); |
|
|
|
XSetWindowBackground(dpy, locks[screen]->win, locks[screen]->colors[failure || failonclear ? FAILED : INIT]); |
|
|
|
XClearWindow(dpy, locks[screen]->win); |
|
|
|
XClearWindow(dpy, locks[screen]->win); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|