[sawfish] reverted mouse branch merge
- From: Christopher Bratusek <chrisb src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [sawfish] reverted mouse branch merge
- Date: Tue, 17 Nov 2009 17:38:59 +0000 (UTC)
commit 5686c9d418fb525aba4780d5469512b7920083bb
Author: Christopher Roy Bratusek <chris nanolx org>
Date: Tue Nov 17 18:38:24 2009 +0100
reverted mouse branch merge
ChangeLog | 4 ----
src/keys.c | 26 +++++++++++++++++++++++---
src/keys.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 74 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8417e64..9bd16b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -221,10 +221,6 @@
-- (merged earlier already)
- fixed doc-window properties
- * src/keys.h: merged timo/mouse branch
- - removed built-in (hackish) support for Mousebuttons 6 - 9
- - use evdev if you need support for those buttons, instead
-
* lisp/sawfish/wm/ext/fdo-menu.jl: merged timo/fdo-fix branch
- improved find-lang-string
- s/\012/\n/
diff --git a/src/keys.c b/src/keys.c
index 1ca0178..f4d3c64 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -97,7 +97,7 @@ DEFSYM(super_keysyms, "super-keysyms");
static void grab_keymap_event (repv km, long code, long mods, bool grab);
static void grab_all_keylist_events (repv map, bool grab);
-static int all_buttons[5] = { Button1, Button2, Button3, Button4, Button5 };
+static int all_buttons[9] = { Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9 };
/* locks: currently LockMask, num_lock, and scroll_lock */
static int total_lock_combs, all_lock_mask;
@@ -262,6 +262,18 @@ translate_event(unsigned long *code, unsigned long *mods, XEvent *xev)
case Button5:
*mods |= Button5Mask;
break;
+ case Button6:
+ *mods |= Button6Mask;
+ break;
+ case Button7:
+ *mods |= Button7Mask;
+ break;
+ case Button8:
+ *mods |= Button8Mask;
+ break;
+ case Button9:
+ *mods |= Button9Mask;
+ break;
}
ret = TRUE;
break;
@@ -333,6 +345,10 @@ translate_event_to_x_button (repv ev, unsigned int *button, unsigned int *state)
{ Button3, Button3Mask },
{ Button4, Button4Mask },
{ Button5, Button5Mask },
+ { Button6, Button6Mask },
+ { Button7, Button7Mask },
+ { Button8, Button8Mask },
+ { Button9, Button9Mask },
{ 0, 0 }
};
int i;
@@ -654,6 +670,10 @@ static struct key_def default_mods[] = {
{ "Button3", Button3Mask },
{ "Button4", Button4Mask },
{ "Button5", Button5Mask },
+ { "Button6", Button6Mask },
+ { "Button7", Button7Mask },
+ { "Button8", Button8Mask },
+ { "Button9", Button9Mask },
{ "Any", EV_MOD_ANY },
{ "Release", EV_MOD_RELEASE },
{ 0, 0 }
@@ -1686,7 +1706,7 @@ grab_event (Window grab_win, repv ev)
{
/* sawfish treats mouse buttons as modifiers, not as
codes, so for us AnyModifier includes all buttons.. */
- for (i = 0; i < 5; i++)
+ for (i = 0; i < 9; i++)
{
XGrabButton (dpy, all_buttons[i], AnyModifier,
grab_win, False, POINTER_GRAB_EVENTS,
@@ -1738,7 +1758,7 @@ ungrab_event (Window grab_win, repv ev)
}
else
{
- for (i = 0; i < 5; i++)
+ for (i = 0; i < 9; i++)
XUngrabButton (dpy, all_buttons[i], AnyModifier, grab_win);
}
}
diff --git a/src/keys.h b/src/keys.h
index ff807b8..c6b0395 100644
--- a/src/keys.h
+++ b/src/keys.h
@@ -71,8 +71,57 @@ enum {
EV_VIRT_MOD_MASK = 0x0ff00000
};
-#define EV_MOD_BUTTON_MASK \
- (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)
+/* Support for buttons 6, 7, 8 and 9.
+
+ <X11/X.h> doesn't define these, even though XFree supports them.. */
+
+#ifndef Button6
+# define Button6 6
+#endif
+#ifndef Button6Mask
+# define Button6Mask (1<<13)
+#endif
+
+#ifndef Button7
+# define Button7 7
+#endif
+#ifndef Button7Mask
+# define Button7Mask (1<<14)
+#endif
+
+#ifndef Button8
+# define Button8 8
+#endif
+#ifndef Button8Mask
+# define Button8Mask (1<<15)
+#endif
+
+#ifndef Button9
+# define Button9 9
+#endif
+#ifndef Button9Mask
+# define Button9Mask (1<<16)
+#endif
+
+#if !defined (Button6)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask)
+#elif !defined (Button7)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask)
+#elif !defined (Button8)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask \
+ | Button7Mask)
+#elif !defined (Button9)
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask \
+ | Button7Mask | Button8Mask)
+#else
+# define EV_MOD_BUTTON_MASK (Button1Mask | Button2Mask | Button3Mask \
+ | Button4Mask | Button5Mask | Button6Mask \
+ | Button7Mask | Button8Mask | Button9Mask)
+#endif
/* In key maps, a `key' is (COMMAND . EVENT) */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]