diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d35f0c9..2ffccab 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,11 @@ Version 1.0 ---------------------------------------------------------------------- +2009-05-03: + * fix for #20, not beeing able to use the xf86-misc extensions shouldn't + make alock stop working. background: xorg removed xf86-misc and + 'AllowDeactivateGrabs' etc. + * typos and minor stuff in 'configure' + 2009-02-25: * fix for #5, avoid beeing bypassed by disabling 'AllowClosedownGrabs' and 'AllowDeactivateGrabs' diff --git a/configure b/configure index ff160cc..f6aa8fa 100755 --- a/configure +++ b/configure @@ -89,7 +89,7 @@ EOF else echo "no." echo "error, can't compile with imlib2 support. check 'config.log'" - echo "for further detailts." + echo "for further details." exit 1 fi else @@ -121,14 +121,13 @@ EOF echo "CFLAGS_XRENDER:=" >&4 echo "LDFLAGS_XRENDER:=-lXrender" >&4 echo "" >&4 - else - echo "no." - exit 1 + return fi - else - echo "no." - exit 1 fi + echo "no." + echo "error, can't compile/link with xrender support." + echo "check 'config.log' for further details." + exit 1 } check_xcursor() { @@ -155,14 +154,13 @@ EOF echo "LDFLAGS_XCURSOR:=" >&4 echo "LIBS_XCURSOR:=-lXcursor" >&4 echo "" >&4 - else - echo "no." - exit 1 + return fi - else - echo "no." - exit 1 fi + echo "no." + echo "error, can't compile/link with xcursor support." + echo "check 'config.log' for further details." + exit 1 } check_xf86misc() { diff --git a/src/alock.c b/src/alock.c index 9e933c8..31299db 100644 --- a/src/alock.c +++ b/src/alock.c @@ -406,8 +406,8 @@ int main(int argc, char **argv) { struct aOpts opts; #if HAVE_XF86MISC - int xf86misc_major = 0; - int xf86misc_minor = 0; + int xf86misc_major = -1; + int xf86misc_minor = -1; #endif int arg = 0; @@ -589,21 +589,18 @@ int main(int argc, char **argv) { #if HAVE_XF86MISC { - if (XF86MiscQueryVersion(xinfo.display, &xf86misc_major, &xf86misc_minor) == False) { + if (XF86MiscQueryVersion(xinfo.display, &xf86misc_major, &xf86misc_minor) == True) { - printf("%s", "alock: failed to call XF86MiscQueryVersion.\n"); - exit(EXIT_FAILURE); + if (xf86misc_major >= 0 && + xf86misc_minor >= 5 && + XF86MiscSetGrabKeysState(xinfo.display, False) == MiscExtGrabStateLocked) { + + printf("%s", "alock: cant disable xserver hotkeys to remove grabs.\n"); + exit(EXIT_FAILURE); + } + + printf("%s", "disabled AllowDeactivateGrabs and AllowClosedownGrabs\n."); } - - if (xf86misc_major >= 0 && - xf86misc_minor >= 5 && - XF86MiscSetGrabKeysState(xinfo.display, False) == MiscExtGrabStateLocked) { - - printf("%s", "alock: cant disable xserver hotkeys to remove grabs.\n"); - exit(EXIT_FAILURE); - } - - printf("%s", "disabled AllowDeactivateGrabs and AllowClosedownGrabs\n."); } #endif