summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-06-11 08:59:45 +0000
committersabetts <sabetts>2001-06-11 08:59:45 +0000
commit7dae9b9525e19cf79d616f7feb1f69c874238b3f (patch)
treeb3ddc864c69d8df1f082f6565b0906d1e8636132
parent134ec76508d6c30a0d1bd972255c9498adae86d8 (diff)
downloadratpoison-7dae9b9525e19cf79d616f7feb1f69c874238b3f.zip
* 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
-rw-r--r--ChangeLog9
-rw-r--r--src/conf.h8
-rw-r--r--src/events.c10
3 files changed, 24 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8116386..64688de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-06-11 shawn <sabetts@diggin.lamenet.tmp>
+
+ * 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
+
2001-06-10 shawn <sabetts@diggin.lamenet.tmp>
* src/actions.c (cmd_generate): return if there is no current
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)
{