summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2000-10-30 21:40:16 +0000
committersabetts <sabetts>2000-10-30 21:40:16 +0000
commit829be00d69387bd9114db64d3bab5f235fdc1bc4 (patch)
tree4adf83eb62362009dc2d665e2093969df2395ed7
parent3447cb9fe7c1a28d44b1b9b98c6227a4bb9075fe (diff)
downloadratpoison-829be00d69387bd9114db64d3bab5f235fdc1bc4.zip
added ifdef's to toggle the hide mouse feature
-rw-r--r--src/ChangeLog4
-rw-r--r--src/conf.h2
-rw-r--r--src/events.c28
-rw-r--r--src/manage.c7
4 files changed, 14 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 360f096..2ade402 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2000-10-30 shawn <sabetts@badbox.secure.basis.org>
+
+ * conf.h: added HIDE_MOUSE
+
2000-10-24 Ryan Yeske <rcyeske@vcn.bc.ca>
* bar.c (bar_x): rightmost border is no longer off screen
diff --git a/src/conf.h b/src/conf.h
index 3cbb85d..3092bc6 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -23,6 +23,8 @@
#define KEY_PREFIX 't'
#define MODIFIER_PREFIX ControlMask
+//#define HIDE_MOUSE /* Pressing a key sends the mouse to the bottom right corner */
+
#define BAR_FG_COLOR "Gray60"
#define BAR_BG_COLOR "Lightgreen"
#define BAR_BOLD_COLOR "Black" /* To indicate the current window */
diff --git a/src/events.c b/src/events.c
index 9ac37ad..6030242 100644
--- a/src/events.c
+++ b/src/events.c
@@ -302,11 +302,9 @@ key_press (XEvent *ev)
s = find_screen (ev->xkey.root);
- if (rat_visible)
- {
- XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->root_attr.width - 2, s->root_attr.height - 2);
- rat_visible = 0;
- }
+#ifdef HIDE_MOUSE
+ XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, s->root_attr.width - 2, s->root_attr.height - 2);
+#endif
if (!s) return;
@@ -347,25 +345,6 @@ property_notify (XEvent *ev)
}
}
-void
-rat_motion (XMotionEvent *ev)
-{
- screen_info *s;
- s = find_screen (ev->root);
- if (!s) return;
-
- if (ev->x_root == s->root_attr.width - 2 && ev->y_root == s->root_attr.height - 2) return;
-
- if (!rat_visible)
- {
- XWarpPointer (dpy, None, rp_current_window->w, 0, 0, 0, 0, rat_x, rat_y);
- rat_visible = 1;
- }
-
- rat_x = ev->x_root;
- rat_y = ev->y_root;
-}
-
/* Given an event, call the correct function to handle it. */
void
delegate_event (XEvent *ev)
@@ -434,7 +413,6 @@ delegate_event (XEvent *ev)
case MotionNotify:
PRINT_DEBUG ("MotionNotify\n");
- rat_motion (&ev->xmotion);
break;
case Expose:
diff --git a/src/manage.c b/src/manage.c
index 3e72f5f..a4b6eeb 100644
--- a/src/manage.c
+++ b/src/manage.c
@@ -42,10 +42,13 @@ extern Atom wm_state;
static void
grab_prefix_key (Window w)
{
+#ifdef HIDE_MOUSE
XGrabKey(dpy, AnyKey, AnyModifier, w, True,
GrabModeAsync, GrabModeAsync);
-/* XGrabKey(dpy, XKeysymToKeycode (dpy, KEY_PREFIX ), MODIFIER_PREFIX, w, True, */
-/* GrabModeAsync, GrabModeAsync); */
+#else
+ XGrabKey(dpy, XKeysymToKeycode (dpy, KEY_PREFIX ), MODIFIER_PREFIX, w, True,
+ GrabModeAsync, GrabModeAsync);
+#endif
}
char *