tags 432073 fixed-upstream patch
thanks

Build with patch uloaded to http://uvw.ru/debian/fluxbox/fluxbox-1.0/

http://uvw.ru/debian/fluxbox/fluxbox-1.0/fluxbox_1.0~rc3-3.diff.gz
http://uvw.ru/debian/fluxbox/fluxbox-1.0/fluxbox_1.0~rc3-3.dsc
http://uvw.ru/debian/fluxbox/fluxbox-1.0/fluxbox_1.0~rc3.orig.tar.gz

patch attached
#! /bin/sh /usr/share/dpatch/dpatch-run
## 70_caps_lock_mod5_fix_patch.dpatch by  <[EMAIL PROTECTED]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix: no longer interprets mod5 modifier

@DPATCH@

--- fluxbox-1.0~rc3/src/FbTk/KeyUtil.cc
+++ fluxbox-1.0~rc3/src/FbTk/KeyUtil.cc
@@ -62,7 +62,7 @@
 
 
 KeyUtil::KeyUtil()
-    : m_modmap(0), m_capslock(0), m_numlock(0), m_scrolllock(0)
+    : m_modmap(0), m_numlock(0), m_scrolllock(0)
 {
     init();
 }
@@ -93,9 +93,9 @@
                     m_modmap->modifiermap[realkey], 0);
 
             switch (ks) {
-            case XK_Caps_Lock:
-                m_capslock = modlist[i].mask;
-                break;
+            // we just want to clean the Lock modifier, not specifically the
+            // XK_Caps_Lock key
+            // the others tend to vary from distro to distro, though
             case XK_Scroll_Lock:
                 m_scrolllock = modlist[i].mask;
                 break;
@@ -114,13 +114,12 @@
 */
 void KeyUtil::grabKey(unsigned int key, unsigned int mod, Window win) {
     Display *display = App::instance()->display();
-    const unsigned int capsmod = instance().capslock();
     const unsigned int nummod = instance().numlock();
     const unsigned int scrollmod = instance().scrolllock();
 
     // Grab with numlock, capslock and scrlock
     for (int i = 0; i < 8; i++) {
-        XGrabKey(display, key, mod | (i & 1 ? capsmod : 0) |
+        XGrabKey(display, key, mod | (i & 1 ? LockMask : 0) |
                  (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
                  win, True, GrabModeAsync, GrabModeAsync);
     }
@@ -130,13 +129,12 @@
 void KeyUtil::grabButton(unsigned int button, unsigned int mod, Window win,
                          unsigned int event_mask, Cursor cursor) {
     Display *display = App::instance()->display();
-    const unsigned int capsmod = instance().capslock();
     const unsigned int nummod = instance().numlock();
     const unsigned int scrollmod = instance().scrolllock();
 
     // Grab with numlock, capslock and scrlock
     for (int i = 0; i < 8; i++) {
-        XGrabButton(display, button, mod | (i & 1 ? capsmod : 0) |
+        XGrabButton(display, button, mod | (i & 1 ? LockMask : 0) |
                     (i & 2 ? nummod : 0) | (i & 4 ? scrollmod : 0),
                     win, False, event_mask, GrabModeAsync, GrabModeAsync,
                     None, cursor);
--- fluxbox-1.0~rc3/src/FbTk/KeyUtil.hh
+++ fluxbox-1.0~rc3/src/FbTk/KeyUtil.hh
@@ -69,8 +69,9 @@
         @return the cleaned state number
     */
     unsigned int cleanMods(unsigned int mods) {
-        //remove numlock, capslock and scrolllock
-         return mods & ~(capslock() | numlock() | scrolllock());
+        // remove numlock, capslock, and scrolllock
+        // and anything beyond Button5Mask
+        return mods & ~(capslock() | numlock() | scrolllock()) & ((1<<13) - 1);
     }
 
     /** 
@@ -87,14 +88,14 @@
     */
     static unsigned int keycodeToModmask(unsigned int keycode);
     int numlock() const { return m_numlock; }
-    int capslock() const { return m_capslock; }
+    int capslock() const { return LockMask; }
     int scrolllock() const { return m_scrolllock; }
 
 private:
     void loadModmap();
 
     XModifierKeymap *m_modmap;
-    int m_capslock, m_numlock, m_scrolllock;
+    int m_numlock, m_scrolllock;
     static std::auto_ptr<KeyUtil> s_keyutil;
 };
 

Attachment: signature.asc
Description: Digital signature

Reply via email to