changeset 57333:3bce830e4b33

* xterm.c (x_find_modifier_meanings): Ignore any Super or Hyper for a row if Alt or Meta has been found for that row. Also stop scanning for Keysyms for that row.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 05 Oct 2004 10:52:53 +0000
parents 304307d73431
children 37199d6ac2c7
files src/ChangeLog src/xterm.c
diffstat 2 files changed, 24 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Oct 05 08:57:14 2004 +0000
+++ b/src/ChangeLog	Tue Oct 05 10:52:53 2004 +0000
@@ -1,3 +1,9 @@
+2004-10-05  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xterm.c (x_find_modifier_meanings): Ignore any Super or Hyper for
+	a row if Alt or Meta has been found for that row.  Also stop scanning
+	for Keysyms for that row.
+
 2004-10-04  Kim F. Storm  <storm@cua.dk>
 
 	* fringe.c (Ffringe_bitmaps_at_pos): Change return value from cons
--- a/src/xterm.c	Tue Oct 05 08:57:14 2004 +0000
+++ b/src/xterm.c	Tue Oct 05 10:52:53 2004 +0000
@@ -3383,12 +3383,14 @@
      Alt keysyms are on.  */
   {
     int row, col;	/* The row and column in the modifier table.  */
+    int found_alt_or_meta;
 
     for (row = 3; row < 8; row++)
+    {
+      found_alt_or_meta = 0;
       for (col = 0; col < mods->max_keypermod; col++)
 	{
-	  KeyCode code
-	    = mods->modifiermap[(row * mods->max_keypermod) + col];
+	  KeyCode code = mods->modifiermap[(row * mods->max_keypermod) + col];
 
 	  /* Zeroes are used for filler.  Skip them.  */
 	  if (code == 0)
@@ -3406,33 +3408,44 @@
 		  {
 		  case XK_Meta_L:
 		  case XK_Meta_R:
+		    found_alt_or_meta = 1;
 		    dpyinfo->meta_mod_mask |= (1 << row);
 		    break;
 
 		  case XK_Alt_L:
 		  case XK_Alt_R:
+		    found_alt_or_meta = 1;
 		    dpyinfo->alt_mod_mask |= (1 << row);
 		    break;
 
 		  case XK_Hyper_L:
 		  case XK_Hyper_R:
-		    dpyinfo->hyper_mod_mask |= (1 << row);
+		    if (!found_alt_or_meta)
+		      dpyinfo->hyper_mod_mask |= (1 << row);
+		    code_col = syms_per_code;
+		    col = mods->max_keypermod;
 		    break;
 
 		  case XK_Super_L:
 		  case XK_Super_R:
-		    dpyinfo->super_mod_mask |= (1 << row);
+		    if (!found_alt_or_meta)
+		      dpyinfo->super_mod_mask |= (1 << row);
+		    code_col = syms_per_code;
+		    col = mods->max_keypermod;
 		    break;
 
 		  case XK_Shift_Lock:
 		    /* Ignore this if it's not on the lock modifier.  */
-		    if ((1 << row) == LockMask)
+		    if (!found_alt_or_meta && ((1 << row) == LockMask))
 		      dpyinfo->shift_lock_mask = LockMask;
+		    code_col = syms_per_code;
+		    col = mods->max_keypermod;
 		    break;
 		  }
 	      }
 	  }
 	}
+    }
   }
 
   /* If we couldn't find any meta keys, accept any alt keys as meta keys.  */