summaryrefslogtreecommitdiff
path: root/slock.c
diff options
context:
space:
mode:
Diffstat (limited to 'slock.c')
-rw-r--r--slock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/slock.c b/slock.c
index 0ec5b18..4a8ad63 100644
--- a/slock.c
+++ b/slock.c
@@ -152,8 +152,10 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
int t_pos[] = {(diasize[0] / 2) - (l_size / 2) + w_pos[0], w_pos[1]};
int t_len[] = {diasize[0] + w_pos[0], w_pos[1] / 3};
+ drw_rect(drw, 0, 0, crtc_info->width, crtc_info->height, 1, 1);
drw_text(drw, t_pos[0], t_pos[1], t_len[0], t_len[1], 0, lock_message, 0);
drw_map(drw, locks[0]->win, 0, 0, crtc_info->width, crtc_info->height);
+
while (running && !XNextEvent(dpy, &ev)) {
@@ -214,7 +216,8 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
oldc = color;
}
- drw_rect(drw, 0, crtc_info->height - w_pos[1], crtc_info->width, w_len[1], 1, 1);
+ drw_rect(drw, 0, 0, crtc_info->width, crtc_info->height, 1, 1);
+ drw_text(drw, t_pos[0], t_pos[1], t_len[0], t_len[1], 0, lock_message, 0);
if (!failure) {
@@ -235,6 +238,11 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
failure = 0;
}
+ if (strlen(passwd) > 0)
+ drw_rect(drw, crtc_info->width / 2 - strlen(passwd) * 15 / 2 - 15, w_pos[1] + diasize[1] + 140, strlen(passwd) * 15 + 33, 47, 0, 0);
+ else
+ drw_rect(drw, crtc_info->width / 2 - 15 / 2 - 15, w_pos[1] + diasize[1] + 140, 15 + 33, 47, 0, 0);
+
drw_map(drw, locks[0]->win, 0, 0, crtc_info->width, crtc_info->height);
} else if (rr->active && ev.type == rr->evbase + RRScreenChangeNotify) {