Xinqi Bao's Git
projects
/
slock.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
4ed35d2
)
fixed DPMS crashing issue
author
Anselm R Garbe <
[email protected]
>
Tue, 8 Apr 2008 08:55:46 +0000
(09:55 +0100)
committer
Anselm R Garbe <
[email protected]
>
Tue, 8 Apr 2008 08:55:46 +0000
(09:55 +0100)
config.mk
diff
|
blob
|
history
slock.c
diff
|
blob
|
history
diff --git
a/config.mk
b/config.mk
index
d17c762
..
442b4cf
100644
(file)
--- a/
config.mk
+++ b/
config.mk
@@
-1,5
+1,5
@@
# slock version
# slock version
-VERSION = 0.
8
+VERSION = 0.
9
# Customize below to fit your system
# Customize below to fit your system
diff --git
a/slock.c
b/slock.c
index
2dc9648
..
0116c70
100644
(file)
--- a/
slock.c
+++ b/
slock.c
@@
-1,5
+1,4
@@
-/* © 2006-2008 Anselm R Garbe <garbeam at gmail dot com>
- * See LICENSE file for license details. */
+/* See LICENSE file for license details. */
#define _XOPEN_SOURCE 500
#if HAVE_SHADOW_H
#include <shadow.h>
#define _XOPEN_SOURCE 500
#if HAVE_SHADOW_H
#include <shadow.h>
@@
-126,11
+125,16
@@
main(int argc, char **argv) {
/* main event loop */
while(running && !XNextEvent(dpy, &ev)) {
/* main event loop */
while(running && !XNextEvent(dpy, &ev)) {
- if(len == 0)
+ if(len == 0
&& DPMSCapable(dpy)
)
DPMSForceLevel(dpy, DPMSModeOff);
if(ev.type == KeyPress) {
buf[0] = 0;
num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0);
DPMSForceLevel(dpy, DPMSModeOff);
if(ev.type == KeyPress) {
buf[0] = 0;
num = XLookupString(&ev.xkey, buf, sizeof buf, &ksym, 0);
+ if(IsKeypadKey(ksym))
+ if(ksym == XK_KP_Enter)
+ ksym = XK_Return;
+ else if(ksym >= XK_KP_0 && ksym <= XK_KP_9)
+ ksym = (ksym - XK_KP_0) + XK_0;
if(IsFunctionKey(ksym) || IsKeypadKey(ksym)
|| IsMiscFunctionKey(ksym) || IsPFKey(ksym)
|| IsPrivateKeypadKey(ksym))
if(IsFunctionKey(ksym) || IsKeypadKey(ksym)
|| IsMiscFunctionKey(ksym) || IsPFKey(ksym)
|| IsPrivateKeypadKey(ksym))