[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: modifiers problems with xlibs 4.3.0.dfsg.1-5



Sebastien,

Thanks for starting a thread on this.  X Strike Force, let's see what we
can do about it.  :)

Mr. Pascal,

I recently backported your change from XFree86 CVS last year:
   172. Add workaround for problems that arise when in multi-layout map
        different modifier keysyms share the same key (Ivan Pascal).

to Debian's packages of XFree86 4.3.0, and promptly got bug reports exactly
the same as XFree86 Bugzilla #580.

Mailing list subscribers,

Please read upstream XFree86 bug report about this:
http://bugs.xfree86.org/show_bug.cgi?id=580

On Sun, Jun 20, 2004 at 05:05:56PM +0200, Sebastien Bacher wrote:
> The new xlibs package (4.3.0.dfsg.1-5) seems to have some modifier'
> problems that breaks alt+tab with metacity for example.
> 
> I've attached the xev output for an "alt+tab" action in a "xinit /usr/
> bin/X11/xev -- :1 vt8 > /tmp/xev.out" to the mail.
> 
> After talking with Brandon

With whom?  :)

> on IRC I've tried to revert some changes to compat/misc (patch
> xlibs-modifier.patch attached to the mail).
> 
> This patch fix the problem on one of my boxes, but has some weird
> effects : if you keep a key pressed xev doesn't stop to display "pressed
> - released - pressed ..."  events instead of displaying one "pressed".
> 
> Then I've tried to replace xkb/symbols/pc/pc with the xlibs -4
> version ... it fixes the "multi-events problem" but my breaks shift/
> altgr/... combinated actions. 
> 
> Does somebody has an idea of what is exactly broken in xlibs 4.3.0.
> dfsg.1-5 ? Let me know if you need more details of the problems ...

I have attached the upstream changeset that caused this problem.

Unfortunately, I don't think just reverting it is the right solution.  Ivan
Pascal is trying to solve a real problem.  We can't just assign certain
modifiers to certain keys on a "base" symbols file like
symbols/pc/pc(basic), because that really screws up people who need to use
multi-level layouts.  Not every layout is going to use the exact same keys
for the exact same modifiers, especially when crazy stuff like Compose,
AltGr, ISO_Lock and so forth gets involved.

Reverting is bad because:
* We'd break compatibility with XFree86 4.4.0;
* We'd break compatibility with X.Org.

At the same time, I suspect the fix in XFree86 #580 is a kludge, because
perhaps not everyone using the pc/pc(basic) symbol map will actually want
Mod1 on <LALT>.

Furthermore, we know that people *still* can't use Alt_R+Tab to cycle
windows, and people whose window managers use the left and/or right Windows
keys together with tab are seeing the same problem.

I'm pretty sure Ivan Pascal is regarded as one of the very few experts on
this subject.  Unless he thinks it was a bad call to move to the "fake key"
approach, I think we're best advised to help him figure out how to
implement a solution that will stick.

I have a few questions:

* Is it possible to non-destructively update a modifier mapping?  I.e., if
  we have:

// xc/programs/xkbcomp/symbols/pc/pc

partial hidden alphanumeric_keys modifier_keys
xkb_symbols "basic" {
/// snip
    modifier_map Mod1   { Alt_L };
}

default
xkb_symbols "pc104" {
    modifier_map Mod1   { Meta_L };
}

And I'm using "pc/pc(104)" for my symbols, is Mod1 on *both* Alt_L and
Meta_L, or just on Meta_L?

I'm wondering if what we need are modifier_add and modifier_del keywords.

E.g.,

    modifier_add Mod1 { Meta_L };

...would map the Mod1 modifier key to Meta_L, *without changing any
existing mappings of Mod1 to any other keys*.  If Mod1 is already mapped to
Meta_L, this directive would be ignored, but not cause an error.

    modifier_del Mod1 { Alt_L };

...would remove any existing mapping of Mod1 to Alt_L.  If Mod1 is not
already mapped to Alt_L, this directive would be ignored, and not cause an
error.

To support Ivan Pascal's approach, I think we're going to need the above
functionality, especially if people are going to keep playing around with
special symbols files like "altwin", "compose", "ctrl".

Maybe what I suggest is already possible, just using a different syntax?

Furthermore, are window managers using bad code to detect press and release
events for modifier keys?  Maybe window managers need to be changed as well
to be smarter about this.

Mr. Pascal, can you help Debian understand this problem?

-- 
G. Branden Robinson                |    The basic test of freedom is
Debian GNU/Linux                   |    perhaps less in what we are free to
branden@debian.org                 |    do than in what we are free not to
http://people.debian.org/~branden/ |    do.                  -- Eric Hoffer
From: Ivan Pascal <pascal@XFree86.Org>
To: cvs-commit@xfree86.org
Subject: CVS Update: xc (branch: trunk)
Date: Thu, 15 May 2003 06:32:01 -0700 (PDT)
Message-Id: <200305151332.h4FDW1Ea079998@public.xfree86.org>
X-Spam-Status: No, hits=0.6 required=6.0
        tests=SPAM_PHRASE_00_01
        version=2.41

CVSROOT:        /home/x-cvs
Module name:    xc
Changes by:     pascal@public.xfree86.org.      03/05/15 06:32:01

Log message:
   172. Add workaround for problems that arise when in multi-layout map
        different modifier keysyms share the same key (Ivan Pascal).

Modified files:
      xc/programs/xkbcomp/compat/:
        iso9995 misc
      xc/programs/xkbcomp/keycodes/:
        xfree86
      xc/programs/xkbcomp/symbols/:
        level3
      xc/programs/xkbcomp/symbols/pc/:
        pc

  Revision      Changes    Path
  1.4           +14 -1     xc/programs/xkbcomp/compat/iso9995
  1.4           +86 -6     xc/programs/xkbcomp/compat/misc
  3.20          +8 -8      xc/programs/xkbcomp/keycodes/xfree86
  1.5           +1 -3      xc/programs/xkbcomp/symbols/level3
  1.8           +18 -8     xc/programs/xkbcomp/symbols/pc/pc

_______________________________________________
Cvs-commit mailing list
Cvs-commit@XFree86.Org
http://XFree86.Org/mailman/listinfo/cvs-commit

Index: compat/iso9995
===================================================================
RCS file: /cvs/xc/programs/xkbcomp/compat/iso9995,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- compat/iso9995	21 Feb 2003 03:16:34 -0000	1.3
+++ compat/iso9995	15 May 2003 13:31:57 -0000	1.4
@@ -3,7 +3,7 @@
 // Fairly complete set of symbol interpretations 
 // to provide reasonable default behavior
 
-// $XFree86: xc/programs/xkbcomp/compat/iso9995,v 1.3 2003/02/21 03:16:34 dawes Exp $
+// $XFree86: xc/programs/xkbcomp/compat/iso9995,v 1.4 2003/05/15 13:31:57 pascal Exp $
 
 default partial xkb_compatibility "default"  {
     virtual_modifiers LevelThree,AltGr;
@@ -23,22 +23,35 @@
     };
 
     interpret ISO_Level3_Shift+Any {
+	useModMapMods= level1;
 	virtualModifier= LevelThree;
 	action= SetMods(modifiers=LevelThree);
     };
 
+    interpret ISO_Level3_Shift {
+	action= SetMods(modifiers=LevelThree);
+    };
+
     interpret ISO_Level3_Latch+Any {
 	useModMapMods= level1;
 	virtualModifier= LevelThree;
 	action= LatchMods(modifiers=LevelThree);
     };
 
+    interpret ISO_Level3_Latch {
+	action= LatchMods(modifiers=LevelThree);
+    };
+
     interpret ISO_Level3_Lock+Any {
 	useModMapMods= level1;
 	virtualModifier= LevelThree;
 	action= LockMods(modifiers=LevelThree);
     };
 
+    interpret ISO_Level3_Lock {
+	action= LockMods(modifiers=LevelThree);
+    };
+
     interpret ISO_Group_Latch {
 	useModMapMods= level1;
 	virtualModifier= AltGr;
Index: compat/misc
===================================================================
RCS file: /cvs/xc/programs/xkbcomp/compat/misc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- compat/misc	21 Feb 2003 03:17:42 -0000	1.3
+++ compat/misc	15 May 2003 13:31:57 -0000	1.4
@@ -2,28 +2,108 @@
 //
 //
 //
-// $XFree86: xc/programs/xkbcomp/compat/misc,v 1.3 2003/02/21 03:17:42 dawes Exp $
+// $XFree86: xc/programs/xkbcomp/compat/misc,v 1.4 2003/05/15 13:31:57 pascal Exp $
 
 default partial xkb_compatibility "misc"  {
 
-    virtual_modifiers	Alt,ScrollLock;
+    virtual_modifiers	Alt,Meta,Super,Hyper,ScrollLock;
 
     // Interpretations for some other useful keys
 
-    interpret Terminate_Server     { action = Terminate(); };
+    interpret Terminate_Server {
+        action = Terminate();
+    };
+
+    setMods.clearLocks= True;
 
     // Sets the "Alt" virtual modifier
 
-    setMods.clearLocks= True;
-    interpret Alt_L+Any     { 
+    interpret Alt_L+Any     {
+        useModMapMods= level1;
+	virtualModifier= Alt;
+	action = SetMods(modifiers=modMapMods);
+    };
+
+    interpret Alt_L	{
+	action = SetMods(modifiers=Alt);
+    };
+
+    interpret Alt_R+Any     {
+        useModMapMods= level1;
 	virtualModifier= Alt;
 	action = SetMods(modifiers=modMapMods);
     };
 
-    interpret Alt_R+Any	{
+    interpret Alt_R	{
+	action = SetMods(modifiers=Alt);
+    };
+
+    // Sets the "Meta" virtual modifier
+
+    interpret Meta_L+Any     {
+        useModMapMods= level1;
+	virtualModifier= Meta;
+	action = SetMods(modifiers=modMapMods);
+    };
+
+    interpret Meta_L	{
+	action = SetMods(modifiers=Meta);
+    };
+
+    interpret Meta_R+Any     {
+        useModMapMods= level1;
+	virtualModifier= Meta;
+	action = SetMods(modifiers=modMapMods);
+    };
+
+    interpret Meta_R	{
 	action = SetMods(modifiers=Alt);
     };
 
+    // Sets the "Super" virtual modifier
+
+    interpret Super_L+Any     {
+        useModMapMods= level1;
+	virtualModifier= Super;
+	action = SetMods(modifiers=modMapMods);
+    };
+
+    interpret Super_L	{
+	action = SetMods(modifiers=Super);
+    };
+
+    interpret Super_R+Any     {
+        useModMapMods= level1;
+	virtualModifier= Super;
+	action = SetMods(modifiers=modMapMods);
+    };
+
+    interpret Super_R	{
+	action = SetMods(modifiers=Super);
+    };
+
+    // Sets the "Hyper" virtual modifier
+
+    interpret Hyper_L+Any     {
+        useModMapMods= level1;
+	virtualModifier= Hyper;
+	action = SetMods(modifiers=modMapMods);
+    };
+
+    interpret Hyper_L	{
+	action = SetMods(modifiers=Hyper);
+    };
+
+    interpret Hyper_R+Any     {
+        useModMapMods= level1;
+	virtualModifier= Hyper;
+	action = SetMods(modifiers=modMapMods);
+    };
+
+    interpret Hyper_R	{
+	action = SetMods(modifiers=Hyper);
+    };
+
     // Sets the "ScrollLock" virtual modifier and
     // makes it actually lock when pressed.  Sets
     // up a map for the scroll lock indicator.
Index: keycodes/xfree86
===================================================================
RCS file: /cvs/xc/programs/xkbcomp/keycodes/xfree86,v
retrieving revision 3.19
retrieving revision 3.20
diff -u -r3.19 -r3.20
--- keycodes/xfree86	19 Apr 2003 12:22:09 -0000	3.19
+++ keycodes/xfree86	15 May 2003 13:31:58 -0000	3.20
@@ -3,7 +3,7 @@
 
 
 
-// $XFree86: xc/programs/xkbcomp/keycodes/xfree86,v 3.19 2003/04/19 12:22:09 pascal Exp $
+// $XFree86: xc/programs/xkbcomp/keycodes/xfree86,v 3.20 2003/05/15 13:31:58 pascal Exp $
 
 // "standard" XFree86 codes
 // It seems that the "default" must be the first entry in the file.
@@ -294,13 +294,13 @@
 
     // Other codes never generated.  The XFree86 ddx never generates
     // these codes.
-
-    // <U5D> =    93;
-    // <U7C> =   124;
-    // <U7D> =   125;
-    // <U7E> =   126;
-    // <U7F> =   127;
-    // <U80> =   128;
+    // Thus we can use them as fake keys
+    <MDSW> =    93; // <U5D>
+    <LVL3> =   124; // <U7C>
+    <ALT>  =   125; // <U7D>
+    <META> =   126; // <U7E>
+    <SUPR> =   127; // <U7F>
+    <HYPR> =   128; // <U80>
 
     indicator 1 = "Caps Lock";
     indicator 2 = "Num Lock";
Index: symbols/level3
===================================================================
RCS file: /cvs/xc/programs/xkbcomp/symbols/level3,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- symbols/level3	5 May 2003 12:11:10 -0000	1.4
+++ symbols/level3	15 May 2003 13:31:59 -0000	1.5
@@ -1,7 +1,7 @@
 // using the level(switch) map, the right Control key temporarily
 // chooses the third group level (until it is released).
 //
-// $XFree86: xc/programs/xkbcomp/symbols/level3,v 1.4 2003/05/05 12:11:10 pascal Exp $
+// $XFree86: xc/programs/xkbcomp/symbols/level3,v 1.5 2003/05/15 13:31:59 pascal Exp $
 //
 
 partial modifier_keys
@@ -18,7 +18,6 @@
     type[Group1]="ONE_LEVEL",
     symbols[Group1] = [ ISO_Level3_Shift ]
     };
-  modifier_map Mod5   { ISO_Level3_Shift };
 };
 
 partial modifier_keys
@@ -27,7 +26,6 @@
     type[Group1]="TWO_LEVEL",
     symbols[Group1] = [ ISO_Level3_Shift, Multi_key ]
     };
-  modifier_map Mod5   { ISO_Level3_Shift };
 };
 
 // using the level(menu_switch) map, the Menu key temporarily
Index: symbols/pc/pc
===================================================================
RCS file: /cvs/xc/programs/xkbcomp/symbols/pc/pc,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- symbols/pc/pc	19 Apr 2003 12:22:12 -0000	1.7
+++ symbols/pc/pc	15 May 2003 13:32:00 -0000	1.8
@@ -1,6 +1,6 @@
 
 //
-// $XFree86: xc/programs/xkbcomp/symbols/pc/pc,v 1.7 2003/04/19 12:22:12 pascal Exp $
+// $XFree86: xc/programs/xkbcomp/symbols/pc/pc,v 1.8 2003/05/15 13:32:00 pascal Exp $
 
 partial hidden alphanumeric_keys modifier_keys 
 xkb_symbols "basic" {
@@ -170,13 +170,28 @@
     key <KPDL> {  	[  KP_Delete,	KP_Decimal ]	};
     // End "Keypad" section
 
-
     // begin modifier mappings
     modifier_map Shift  { Shift_L, Shift_R };
     modifier_map Lock   { Caps_Lock, ISO_Lock };
     modifier_map Control{ Control_L, Control_R };
-    modifier_map Mod1   { Alt_L, Alt_R };
     modifier_map Mod2   { Num_Lock };
+
+    //  Fake keys for virtual<->real modifiers mapping 
+    key <LVL3> {	[ ISO_Level3_Shift	]	};
+    key <MDSW> {	[ Mode_switch 		]	};
+    modifier_map Mod5   { <LVL3>, <MDSW> };
+
+    key <ALT>  {	[ Alt_L		]	};
+    modifier_map Mod1   { <ALT> };
+
+    key <META> {	[ Meta_L	]	};
+    modifier_map Mod1   { <META> };
+
+    key <SUPR> {	[ Super_L	]	};
+    modifier_map Mod4   { <SUPR> };
+
+    key <HYPR> {	[ Hyper_L	]	};
+    modifier_map Mod4   { <HYPR> };
 };
 
 // definition for the PC-AT type 101 key keyboard
@@ -185,8 +200,6 @@
     key <LALT> {	[ 	Alt_L,	Meta_L 		]	};
     key <RALT> {	[	Alt_R,	Meta_R		]	};
 
-    // begin modifier mappings
-    modifier_map Mod1   { Alt_L, Alt_R, Meta_L, Meta_R };
 };
 
 // definition for the extra key on 102-key keyboards
@@ -205,9 +218,6 @@
     key <RWIN> {	[	Super_R			]	};
     key <MENU> {	[	Menu			]	};
 
-    // modifier mappings
-    modifier_map Mod1   { Alt_L, Alt_R, Meta_L, Meta_R };
-    modifier_map Mod4   { Super_L, Super_R };
 };
 
 // defintion which includes both the Windows95 keyboards _and_

Attachment: signature.asc
Description: Digital signature


Reply to: