LOGIN / SIGN UP

#187 Keyboard layout disability

Reported by: Flat Rose Noname (flatr0ze) Assigned to: Andreas (ioerror)
Phase: release-0.1.11 Component: windowmanager
Type: bug Status: closed
Priority: 2: High
Watchers:

Attachments

Description

After switching from normal (us) keyboard layout with Alt+Shift I get windows' position frozen and, in fact, the only 3 things I can do with WM is to close window, call a menu or sub-menu for window titlebar. After switching back it's working again. I'm using us, de and ru layouts, which are setted up in /etc/X11/xorg.conf. OS is Arch.linux, all software has latest versions. Ready to give any other information for further resolution of this bug. Thank you.

2009-08-25

03:35:31

Good, I will push it to git.

03:35:30 changed from open to closed

2009-08-20

15:44:13

It seems to be OK. Tested at two machines with Arch Linux.

2009-08-18

03:44:11 attached 187-fix.diff
03:44:11

I prefer to add the masking to stripStateModifiers(), but thanks again for finding the fix, Idares.

Please test the attached patch for any regressions.

2009-08-12

16:04:20

Only by tracing output from xev.

00:53:43 changed from new to open
00:53:38

Thank you for handing in a patch. May ask where you find out about KbdLayoutMask{1,2}?

2009-08-11

18:28:37

I made a patch that should fix this. Tested on Arch Linux, X.Org X Server 1.6.3

diff --git a/src/ActionHandler.cc b/src/ActionHandler.cc
index 10cea3c..d044bd1 100644
--- a/src/ActionHandler.cc
+++ b/src/ActionHandler.cc
@@ -520,6 +520,7 @@ ActionHandler::findMouseAction(uint button, uint state, MouseEventType type, std
 
     state &= ~PScreen::instance()->getNumLock() & ~PScreen::instance()->getScrollLock() & ~LockMask;
     state &= ~Button1Mask & ~Button2Mask & ~Button3Mask & ~Button4Mask & ~Button5Mask;
+    state = PScreen::instance()->stripKbdLayoutModifiers(state);
 
     list<ActionEvent>::iterator it(actions->begin());
     for (; it != actions->end(); ++it) {
diff --git a/src/KeyGrabber.cc b/src/KeyGrabber.cc
index 57bb724..d157d16 100644
--- a/src/KeyGrabber.cc
+++ b/src/KeyGrabber.cc
@@ -336,6 +336,7 @@ KeyGrabber::findAction(XKeyEvent *ev, KeyGrabber::Chain *chain)
         return 0;
     }
     ev->state &= ~_num_lock & ~_scroll_lock & ~LockMask;
+    ev->state = PScreen::instance()->stripKbdLayoutModifiers(ev->state);
 
     ActionEvent *action = 0;
     KeyGrabber::Chain *sub_chain = _global_chain.findChain(ev);
@@ -347,6 +348,7 @@ KeyGrabber::findAction(XKeyEvent *ev, KeyGrabber::Chain *chain)
         while (! exit) {
             XMaskEvent(_scr->getDpy(), KeyPressMask, &c_ev);
             c_ev.xkey.state &= ~_num_lock & ~_scroll_lock & ~LockMask;
+            c_ev.xkey.state = PScreen::instance()->stripKbdLayoutModifiers(c_ev.xkey.state);
 
             if (IsModifierKey(XKeycodeToKeysym(_scr->getDpy(),
                                                c_ev.xkey.keycode, 0))) {
diff --git a/src/PDecor.cc b/src/PDecor.cc
index 46c0ffe..3bc532c 100644
--- a/src/PDecor.cc
+++ b/src/PDecor.cc
@@ -620,6 +620,7 @@ PDecor::handleButtonRelease(XButtonEvent *ev)
     // Remove state modifiers from event
     ev->state = PScreen::instance()->stripStateModifiers(ev->state);
     ev->state = PScreen::instance()->stripButtonModifiers(ev->state);
+    ev->state = PScreen::instance()->stripKbdLayoutModifiers(ev->state);
 
     // handle titlebar buttons
     if (_button) {
diff --git a/src/PScreen.hh b/src/PScreen.hh
index 33f6644..793ef8f 100644
--- a/src/PScreen.hh
+++ b/src/PScreen.hh
@@ -37,6 +37,9 @@ extern unsigned int xerrors_count; /**< Number of X errors occured. */
 #include <list>
 #include <map>
 
+#define KbdLayoutMask1 (1<<13)
+#define KbdLayoutMask2 (1<<14)
+
 /**
  * Class holding information about screen edge allocation.
  */
@@ -148,6 +151,11 @@ public:
         return state;
     }
 
+    unsigned int stripKbdLayoutModifiers(unsigned int state) const {
+        state &= ~KbdLayoutMask1 & ~KbdLayoutMask2;
+        return state;
+    }
+
     void setLockKeys(void);
     inline uint getNumLock(void) const { return _num_lock; }
     inline uint getScrollLock(void) const { return _scroll_lock; }

2009-08-09

19:12:35

It seems keyboard is affected too - keychains are not working.

2009-08-07

18:32:22

I have the same problem: with secondary keyboard layout pekwm does not responding to mouse buttons (keyboard still works). After switching back to primary it is OK again. No difference if layouts are configured in xorg.conf, hal or by setxkbmap

setxkbmap -layout "us,cz" -option "grp:shifts_toggle"

2009-08-05

10:47:41

On machine at work : X -version X.Org X Server 1.6.2

Section "InputDevice"

    Identifier     "Keyboard0"
    Driver         "kbd"
    Option		"XkbRules"	"xorg"
    Option		"XkbLayout"	"us,cz(qwerty),de"
    Option		"XkbOptions"	"compose:ralt,grp:shifts_toggle,grp_led:scroll"

EndSection

second, that is configured via hal will I post later.

2009-08-04

14:50:41

I couldn't reproduce this (using evdev+hal though). Please post your xorg.conf. What version of the X server do you use?

10:05:15

yes, setxkbmap does not cause this. However "standard" X keyboard switching does. No matter if configured via Xorg.conf or via hal.

2009-07-30

15:42:15

try usign command in launcher setxkbmap

2009-06-29

09:54:02

confirming. happens too at my machine. (also Arch).