From 7dae9b9525e19cf79d616f7feb1f69c874238b3f Mon Sep 17 00:00:00 2001 From: sabetts Date: Mon, 11 Jun 2001 08:59:45 +0000 Subject: * src/events.c (grab_rat): wrap in ifdef (ungrab_rat): likewise (handle_key): only change the mouse icon if USE_WAITFORKEY_CURSOR is defined. * src/conf.h (USE_WAITFORKEY_CURSOR): new define --- src/conf.h | 8 +++++++- src/events.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/conf.h b/src/conf.h index a855a21..05727a8 100644 --- a/src/conf.h +++ b/src/conf.h @@ -28,8 +28,14 @@ #define KEY_PREFIX XK_t #define MODIFIER_PREFIX ControlMask +/* After hitting the prefix key ratpoison will change the mouse cursor + to a square to indicate that it is waiting for a second + keystroke. If do not wish this functionality, comment out the + following line. */ +#define USE_WAITFORKEY_CURSOR + /* Quit ratpoison when there are no more managed windows. */ -//#define AUTO_CLOSE +/* #define AUTO_CLOSE */ /* The minimum size of the input window */ #define INPUT_WINDOW_SIZE 200 diff --git a/src/events.c b/src/events.c index 51c8279..86361bf 100644 --- a/src/events.c +++ b/src/events.c @@ -324,6 +324,7 @@ client_msg (XClientMessageEvent *ev) } } +#ifdef USE_WAITFORKEY_CURSOR static void grab_rat () { @@ -331,12 +332,15 @@ grab_rat () GrabModeAsync, GrabModeAsync, None, current_screen()->rat, CurrentTime); } +#endif +#ifdef USE_WAITFORKEY_CURSOR static void ungrab_rat () { XUngrabPointer (dpy, CurrentTime); } +#endif static void handle_key (screen_info *s) @@ -360,7 +364,9 @@ handle_key (screen_info *s) /* Change the mouse icon to indicate to the user we are waiting for more keystrokes */ +#ifdef USE_WAITFORKEY_CURSOR grab_rat(); +#endif read_key (&keysym, &mod, NULL, 0); @@ -386,7 +392,9 @@ handle_key (screen_info *s) free (msg); } +#ifdef USE_WAITFORKEY_CURSOR ungrab_rat(); +#endif } static void @@ -780,8 +788,6 @@ get_event (XEvent *ev) XFlush(dpy); FD_SET(x_fd, &fds); - t.tv_sec = 1; - t.tv_usec = 0; if (select(x_fd+1, &fds, NULL, NULL, NULL) == 1) { -- cgit v1.2.3