aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.mk2
-rw-r--r--slock.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/config.mk b/config.mk
index d17c762..442b4cf 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
1# slock version 1# slock version
2VERSION = 0.8 2VERSION = 0.9
3 3
4# Customize below to fit your system 4# Customize below to fit your system
5 5
diff --git a/slock.c b/slock.c
index 2dc9648..0116c70 100644
--- a/slock.c
+++ b/slock.c
@@ -1,5 +1,4 @@
1/* © 2006-2008 Anselm R Garbe <garbeam at gmail dot com> 1/* See LICENSE file for license details. */
2 * See LICENSE file for license details. */
3#define _XOPEN_SOURCE 500 2#define _XOPEN_SOURCE 500
4#if HAVE_SHADOW_H 3#if HAVE_SHADOW_H
5#include <shadow.h> 4#include <shadow.h>
@@ -126,11 +125,16 @@ main(int argc, char **argv) {
126 125
127 /* main event loop */ 126 /* main event loop */
128 while(running && !XNextEvent(dpy, &ev)) { 127 while(running && !XNextEvent(dpy, &ev)) {
129 if(len == 0) 128 if(len == 0 && DPMSCapable(dpy))
130 DPMSForceLevel(dpy, DPMSModeOff); 129 DPMSForceLevel(dpy, DPMSModeOff);
131 if(ev.type == KeyPress) { 130 if(ev.type == KeyPress) {
132 buf[0] = 0; 131 buf[0] = 0;
133 num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0); 132 num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0);
133 if(IsKeypadKey(ksym))
134 if(ksym == XK_KP_Enter)
135 ksym = XK_Return;
136 else if(ksym >= XK_KP_0 && ksym <= XK_KP_9)
137 ksym = (ksym - XK_KP_0) + XK_0;
134 if(IsFunctionKey(ksym) || IsKeypadKey(ksym) 138 if(IsFunctionKey(ksym) || IsKeypadKey(ksym)
135 || IsMiscFunctionKey(ksym) || IsPFKey(ksym) 139 || IsMiscFunctionKey(ksym) || IsPFKey(ksym)
136 || IsPrivateKeypadKey(ksym)) 140 || IsPrivateKeypadKey(ksym))