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

Bug#256706: Patch to solve XKB mess about modifiers



Here are the same patches ready to be committed; programs/xkbcomp/expr.c
3.7 was added for convenience.

Denis
Index: debian/patches/000_stolen_from_HEAD_xkb_data.diff
===================================================================
--- debian/patches/000_stolen_from_HEAD_xkb_data.diff	(revision 1760)
+++ debian/patches/000_stolen_from_HEAD_xkb_data.diff	(working copy)
@@ -178,6 +178,10 @@
         [...]
   [Ivan Pascal]
 
+xc/programs/xkbcomp/symbols/altwin @ 1.5
+   646. Fix for XKB map 'altwin' to avoid one keysym to more than one modifier
+        mapping (Ivan Pascal).
+
 xc/programs/xkbcomp/symbols/pc/us @ 1.7
    667. Fixes and updates for XKB keyboard maps:
         - Add to 'us' keymap backslash key that can be rewritten in other layouts
@@ -2530,6 +2534,38 @@
 -
 +    include "level3(ralt_switch_multikey)"
  };
+Index: xc/programs/xkbcomp/symbols/altwin
+===================================================================
+RCS file: /cvs/xc/programs/xkbcomp/symbols/altwin,v
+retrieving revision 1.4
+retrieving revision 1.5
+diff -u -r1.4 -r1.5
+--- xc/programs/xkbcomp/symbols/altwin	10 Oct 2001 19:18:32 -0000	1.4
++++ xc/programs/xkbcomp/symbols/altwin	3 Dec 2003 14:09:08 -0000	1.5
+@@ -1,4 +1,4 @@
+-// $XFree86: xc/programs/xkbcomp/symbols/altwin,v 1.4 2001/10/10 19:18:32 herrb Exp $
++// $XFree86: xc/programs/xkbcomp/symbols/altwin,v 1.5 2003/12/03 14:09:08 pascal Exp $
+ 
+ partial modifier_keys 
+ xkb_symbols "meta_alt" {
+@@ -15,7 +15,7 @@
+     key <LWIN> {	[ 	Meta_L			]	};
+     key <RWIN> {	[ 	Meta_R			]	};
+     modifier_map Mod1	{ Alt_L, Alt_R };
+-    modifier_map Mod4	{ Meta_L, Meta_R };
++    modifier_map Mod4	{ <META>, Meta_L, Meta_R };
+ };
+ 
+ partial modifier_keys 
+@@ -23,7 +23,7 @@
+     key <LALT> {	[ 	Alt_L,	Alt_L		]	};
+     key <LWIN> {	[ 	Meta_L			]	};
+     modifier_map Mod1	{ Alt_L };
+-    modifier_map Mod4	{ Meta_L };
++    modifier_map Mod4	{ <META>, Meta_L };
+ };
+ 
+ partial modifier_keys 
 Index: xc/programs/xkbcomp/symbols/pc/am
 ===================================================================
 RCS file: /cvs/xc/programs/xkbcomp/symbols/pc/am,v
Index: debian/patches/000_stolen_from_HEAD.diff
===================================================================
--- debian/patches/000_stolen_from_HEAD.diff	(revision 1760)
+++ debian/patches/000_stolen_from_HEAD.diff	(working copy)
@@ -608,6 +608,18 @@
   Fix manual pages typos (Bugzilla #316, Jens Schweikhardt).
 [Matthieu Herrb]
 
+xc/programs/xmodmap/exec.c @ 1.6
+  634. Fix xmodmap's output of the modifiers map when the first column keysym
+       is empty (Ivan Pascal).
+
+xc/programs/xkbcomp/expr.c @ 3.7
+  351. Fixed string octal number parsing and string to int conversion for "\00"
+       in xkbcomp (BugzillaR #553, Egbert Eich).
+xc/programs/xkbcomp/expr.c @ 3.8
+  Add "modifier_map none" syntax to remove modifier bindings from the
+  specified key.  [Ivan Pascal]
+
+
 diff -urN xc.orig/config/imake/imake.c xc/config/imake/imake.c
 --- xc.orig/config/imake/imake.c	2002-12-17 09:48:27.000000000 +1100
 +++ xc/config/imake/imake.c	2003-04-09 01:58:14.000000000 +1000
@@ -23491,3 +23503,97 @@
  and serving as an example for XTrap functionality, it can reasonably used as
  a primitive "playback" client for X sessions.
  .LP
+Index: xc/programs/xmodmap/exec.c
+===================================================================
+RCS file: /cvs/xc/programs/xmodmap/exec.c,v
+retrieving revision 1.5
+retrieving revision 1.6
+diff -u -r1.5 -r1.6
+--- xc/programs/xmodmap/exec.c	14 Dec 2001 20:02:13 -0000	1.5
++++ xc/programs/xmodmap/exec.c	2 Dec 2003 13:13:57 -0000	1.6
+@@ -56,7 +56,7 @@
+  * Author:  Jim Fulton, MIT X Consortium; derived from parts of the
+  * original xmodmap, written by David Rosenthal, of Sun Microsystems.
+  */
+-/* $XFree86: xc/programs/xmodmap/exec.c,v 1.5 2001/12/14 20:02:13 dawes Exp $ */
++/* $XFree86: xc/programs/xmodmap/exec.c,v 1.6 2003/12/02 13:13:57 pascal Exp $ */
+ 
+ #include <X11/Xos.h>
+ #include <X11/Xlib.h>
+@@ -212,8 +212,13 @@
+ PrintModifierMapping(XModifierKeymap *map, FILE *fp)
+ {
+     int i, k = 0;
++    int min_keycode, max_keycode, keysyms_per_keycode = 0;
+ 
+-    fprintf (fp, 
++    XDisplayKeycodes (dpy, &min_keycode, &max_keycode);
++    XGetKeyboardMapping (dpy, min_keycode, (max_keycode - min_keycode + 1),
++			 &keysyms_per_keycode);
++
++    fprintf (fp,
+     	     "%s:  up to %d keys per modifier, (keycodes in parentheses):\n\n", 
+     	     ProgramName, map->max_keypermod);
+     for (i = 0; i < 8; i++) {
+@@ -222,8 +227,14 @@
+ 	fprintf(fp, "%-10s", modifier_table[i].name);
+ 	for (j = 0; j < map->max_keypermod; j++) {
+ 	    if (map->modifiermap[k]) {
+-		KeySym ks = XKeycodeToKeysym(dpy, map->modifiermap[k], 0);
+-		char *nm = XKeysymToString(ks);
++		KeySym ks;
++		int index = 0;
++		char *nm;
++		do {
++		    ks = XKeycodeToKeysym(dpy, map->modifiermap[k], index);
++		    index++;
++		} while ( !ks && index < keysyms_per_keycode);
++		nm = XKeysymToString(ks);
+ 
+ 		fprintf (fp, "%s  %s (0x%0x)", (j > 0 ? "," : ""), 
+ 			 (nm ? nm : "BadKey"), map->modifiermap[k]);
+Index: xc/programs/xkbcomp/expr.c
+===================================================================
+RCS file: /cvs/xc/programs/xkbcomp/expr.c,v
+retrieving revision 3.6
+retrieving revision 3.8
+diff -u -r3.6 -r3.8
+--- xc/programs/xkbcomp/expr.c	5 Jun 2002 00:00:37 -0000	3.6
++++ xc/programs/xkbcomp/expr.c	18 Dec 2003 14:14:37 -0000	3.8
+@@ -24,7 +24,7 @@
+  THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ 
+  ********************************************************/
+-/* $XFree86: xc/programs/xkbcomp/expr.c,v 3.6 2002/06/05 00:00:37 dawes Exp $ */
++/* $XFree86: xc/programs/xkbcomp/expr.c,v 3.8 2003/12/18 14:14:37 pascal Exp $ */
+ 
+ #include "xkbcomp.h"
+ #include "tokens.h"
+@@ -245,6 +245,7 @@
+ 	{	"mod3",		Mod3MapIndex	},
+ 	{	"mod4",		Mod4MapIndex	},
+ 	{	"mod5",		Mod5MapIndex	},
++	{	"none",		XkbNoModifier	},
+ 	{	NULL,		0		}
+ };
+ 
+@@ -569,9 +570,16 @@
+ 	    if (expr->type==TypeString) {
+ 		register char *str;
+ 		str= XkbAtomGetString(NULL,expr->value.str);
+-		if ((str!=None)&&(strlen(str)==1)) {
+-		    val_rtrn->uval= str[0];
+-		    return True;
++		if (str!=None)
++		    switch (strlen(str)) {
++			case 0:
++			    val_rtrn->uval= 0;
++			    return True;
++			case 1:
++			    val_rtrn->uval= str[0];
++			    return True;
++			default:
++			    break;
+ 		}
+ 	    }
+ 	    if ((expr->type!=TypeInt)&&(expr->type!=TypeFloat)) {
Index: debian/patches/087_xkb_fix_altwin.diff
===================================================================
--- debian/patches/087_xkb_fix_altwin.diff	(revision 1760)
+++ debian/patches/087_xkb_fix_altwin.diff	(working copy)
@@ -20,7 +20,7 @@
      key <LWIN> {	[ 	Meta_L			]	};
      key <RWIN> {	[ 	Meta_R			]	};
 -    modifier_map Mod1	{ Alt_L, Alt_R };
-     modifier_map Mod4	{ Meta_L, Meta_R };
+     modifier_map Mod4	{ <META>, Meta_L, Meta_R };
  };
  
  partial modifier_keys 
@@ -28,6 +28,6 @@
 -    key <LALT> {	[ 	Alt_L,	Alt_L		]	};
      key <LWIN> {	[ 	Meta_L			]	};
 -    modifier_map Mod1	{ Alt_L };
-     modifier_map Mod4	{ Meta_L };
+     modifier_map Mod4	{ <META>, Meta_L };
  };
  

Reply to: