diff options
author | Shawn Betts <sabetts@gmail.com> | 2008-02-11 23:12:09 -0800 |
---|---|---|
committer | Shawn Betts <sabetts@gmail.com> | 2008-02-11 23:12:09 -0800 |
commit | a45a3c2cba130c6164088884d51af7545b7c671a (patch) | |
tree | 982d0f79a45a2abfc5cb779c296daa4adfc970bf /src/actions.c | |
parent | 37933658a66f1d7f5cc00cbf83882b84cf8c8337 (diff) | |
download | ratpoison-a45a3c2cba130c6164088884d51af7545b7c671a.zip |
ifdef out Xtst library calls
Diffstat (limited to 'src/actions.c')
-rw-r--r-- | src/actions.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/actions.c b/src/actions.c index 0de31ed..62107bb 100644 --- a/src/actions.c +++ b/src/actions.c @@ -22,7 +22,6 @@ #include <ctype.h> /* for isspace */ #include <sys/wait.h> #include <X11/keysym.h> -#include <X11/extensions/XTest.h> #include <string.h> #include <strings.h> #include <time.h> @@ -30,6 +29,10 @@ #include <signal.h> #include "ratpoison.h" + +#ifdef HAVE_LIBXTST +# include <X11/extensions/XTest.h> +#endif #define ARG_STRING(elt) args[elt]->string @@ -3099,9 +3102,13 @@ cmd_ratclick (int interactive, struct cmdarg **args) return cmdret_new (RET_SUCCESS, "ratclick: invalid argument"); } +#ifdef HAVE_LIBXTST XTestFakeButtonEvent(dpy, button, True, CurrentTime); XTestFakeButtonEvent(dpy, button, False, CurrentTime); return cmdret_new (RET_SUCCESS, NULL); +#else + return cmdret_new (RET_FAILURE, "ratclick: Please compile with the Xtst extension"); +#endif } cmdret * @@ -3116,6 +3123,7 @@ cmd_rathold (int interactive, struct cmdarg **args) return cmdret_new (RET_SUCCESS, "ratclick: invalid argument"); } +#ifdef HAVE_LIBXTST if (!strcmp(ARG_STRING(0), "down")) XTestFakeButtonEvent(dpy, button, True, CurrentTime); else if(!strcmp(ARG_STRING(0),"up")) @@ -3124,6 +3132,9 @@ cmd_rathold (int interactive, struct cmdarg **args) return cmdret_new (RET_FAILURE, "rathold: '%s' invalid argument", ARG_STRING(0)); return cmdret_new (RET_SUCCESS, NULL); +#else + return cmdret_new (RET_FAILURE, "rathold: Please compile with the Xtst extension"); +#endif } cmdret * |