Compare commits
10 Commits
7d31ff65a0
...
4f045545a2
| Author | SHA1 | Date |
|---|---|---|
|
|
4f045545a2 | |
|
|
265704d736 | |
|
|
35633d4567 | |
|
|
2d2a21a90a | |
|
|
325581b935 | |
|
|
0ff0d9f7a7 | |
|
|
7a604ec1fa | |
|
|
fa11589584 | |
|
|
d5da84cf5a | |
|
|
ae96836f90 |
6
Makefile
6
Makefile
|
|
@ -18,7 +18,7 @@ options:
|
||||||
@echo CC $<
|
@echo CC $<
|
||||||
@${CC} -c ${CFLAGS} $<
|
@${CC} -c ${CFLAGS} $<
|
||||||
|
|
||||||
${OBJ}: config.h config.mk
|
${OBJ}: config.h config.mk arg.h util.h
|
||||||
|
|
||||||
config.h:
|
config.h:
|
||||||
@echo creating $@ from config.def.h
|
@echo creating $@ from config.def.h
|
||||||
|
|
@ -35,8 +35,8 @@ clean:
|
||||||
dist: clean
|
dist: clean
|
||||||
@echo creating dist tarball
|
@echo creating dist tarball
|
||||||
@mkdir -p slock-${VERSION}
|
@mkdir -p slock-${VERSION}
|
||||||
@cp -R LICENSE Makefile README config.def.h config.mk ${SRC} \
|
@cp -R LICENSE Makefile README slock.1 config.mk \
|
||||||
explicit_bzero.c slock.1 slock-${VERSION}
|
${SRC} config.def.h arg.h util.h slock-${VERSION}
|
||||||
@tar -cf slock-${VERSION}.tar slock-${VERSION}
|
@tar -cf slock-${VERSION}.tar slock-${VERSION}
|
||||||
@gzip slock-${VERSION}.tar
|
@gzip slock-${VERSION}.tar
|
||||||
@rm -rf slock-${VERSION}
|
@rm -rf slock-${VERSION}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ static const char *user = "nobody";
|
||||||
static const char *group = "nogroup";
|
static const char *group = "nogroup";
|
||||||
|
|
||||||
static const char *colorname[NUMCOLS] = {
|
static const char *colorname[NUMCOLS] = {
|
||||||
"black", /* after initialization */
|
[INIT] = "black", /* after initialization */
|
||||||
"#005577", /* during input */
|
[INPUT] = "#005577", /* during input */
|
||||||
"#CC3333", /* wrong password */
|
[FAILED] = "#CC3333", /* wrong password */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* treat a cleared input like a wrong password */
|
/* treat a cleared input like a wrong password (color) */
|
||||||
static const int failonclear = 1;
|
static const int failonclear = 1;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# slock version
|
# slock version
|
||||||
VERSION = 1.3
|
VERSION = 1.5
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
|
|
||||||
12
slock.c
12
slock.c
|
|
@ -177,7 +177,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
|
||||||
break;
|
break;
|
||||||
case XK_BackSpace:
|
case XK_BackSpace:
|
||||||
if (len)
|
if (len)
|
||||||
passwd[len--] = '\0';
|
passwd[--len] = '\0';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (num && !iscntrl((int)buf[0]) &&
|
if (num && !iscntrl((int)buf[0]) &&
|
||||||
|
|
@ -201,14 +201,22 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
|
||||||
rre = (XRRScreenChangeNotifyEvent*)&ev;
|
rre = (XRRScreenChangeNotifyEvent*)&ev;
|
||||||
for (screen = 0; screen < nscreens; screen++) {
|
for (screen = 0; screen < nscreens; screen++) {
|
||||||
if (locks[screen]->win == rre->window) {
|
if (locks[screen]->win == rre->window) {
|
||||||
|
if (rre->rotation == RR_Rotate_90 ||
|
||||||
|
rre->rotation == RR_Rotate_270)
|
||||||
|
XResizeWindow(dpy, locks[screen]->win,
|
||||||
|
rre->height, rre->width);
|
||||||
|
else
|
||||||
XResizeWindow(dpy, locks[screen]->win,
|
XResizeWindow(dpy, locks[screen]->win,
|
||||||
rre->width, rre->height);
|
rre->width, rre->height);
|
||||||
XClearWindow(dpy, locks[screen]->win);
|
XClearWindow(dpy, locks[screen]->win);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else for (screen = 0; screen < nscreens; screen++)
|
} else {
|
||||||
|
for (screen = 0; screen < nscreens; screen++)
|
||||||
XRaiseWindow(dpy, locks[screen]->win);
|
XRaiseWindow(dpy, locks[screen]->win);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct lock *
|
static struct lock *
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue