Hello community,

here is the log from the commit of package xorg-x11-server for openSUSE:Factory
checked in at Fri Apr 22 22:51:17 CEST 2011.



--------
--- xorg-x11-server/xorg-x11-server.changes     2011-04-12 11:22:08.000000000 
+0200
+++ /mounts/work_src_done/STABLE/xorg-x11-server/xorg-x11-server.changes        
2011-04-21 16:19:38.000000000 +0200
@@ -1,0 +2,14 @@
+Thu Apr 21 14:16:01 UTC 2011 - [email protected]
+
+- bnc #605015
+  - Enable use of all keyboard layouts, independent of remotely set layout
+  - Remove obsolete xorg-server-xf4vnc-bug605015-vnc-umlauts.diff
+  - xorg-server-xf4vnc-bug605015-fix-keyboard-handling-xinput.diff
+    This should basically already enable the use of other keyboards, if the
+    remote keyboard stays at US.
+  - xorg-server-xf4vnc-bug605015-fix-keycode-lookup-and-isolevel3shift.diff
+    This patch fixes keycode lookup (not using any static keyboard layout any
+    more) and ISO-Level3-Shift handling (enabling the use of keyboard layouts
+    that use AltGr for reaching certain characters).
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
  xorg-server-xf4vnc-bug605015-vnc-umlauts.diff

New:
----
  xorg-server-xf4vnc-bug605015-fix-keyboard-handling-xinput.diff
  xorg-server-xf4vnc-bug605015-fix-keycode-lookup-and-isolevel3shift.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xorg-x11-server.spec ++++++
--- /var/tmp/diff_new_pack.CQ6I6F/_old  2011-04-22 22:50:21.000000000 +0200
+++ /var/tmp/diff_new_pack.CQ6I6F/_new  2011-04-22 22:50:21.000000000 +0200
@@ -32,7 +32,7 @@
 %endif
 Url:            http://xorg.freedesktop.org/
 Version:        7.6_%{dirsuffix}
-Release:        25
+Release:        27
 License:        GPLv2+ ; MIT License (or similar)
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Group:          System/X11/Servers/XF86_4
@@ -79,7 +79,8 @@
 Patch48:        xorg-server-xf4vnc-fix.diff
 Patch49:        xorg-server-xf4vnc-fixes_1_8.diff
 Patch50:        xorg-server-xf4vnc-fixes_1_9.diff
-Patch51:        xorg-server-xf4vnc-bug605015-vnc-umlauts.diff
+Patch51:        xorg-server-xf4vnc-bug605015-fix-keyboard-handling-xinput.diff
+Patch52:        
xorg-server-xf4vnc-bug605015-fix-keycode-lookup-and-isolevel3shift.diff
 %endif
 Patch45:        bug-197858_dpms.diff
 Patch67:        xorg-docs.diff
@@ -209,7 +210,8 @@
 %patch48 -p1
 %patch49 -p0
 %patch50 -p1
-#%patch51 -p1
+%patch51 -p1
+%patch52 -p1
 chmod 755 hw/vnc/symlink-vnc.sh
 %endif
 %patch45 -p0

++++++ xorg-server-xf4vnc-bug605015-fix-keyboard-handling-xinput.diff ++++++
This patch fixes keyboard handling for XInput enabled servers. W/o this patch
the wrong keyboard was used for adding new KeyCodes.

This should basically already enable the use of other keyboards, if the remote
keyboard stays at US.

mhopf - 21/04/2011

Index: xorg-server-1.9.3/hw/vnc/kbdptr.c
===================================================================
--- xorg-server-1.9.3.orig/hw/vnc/kbdptr.c
+++ xorg-server-1.9.3/hw/vnc/kbdptr.c
@@ -46,19 +46,17 @@
 #endif
 
 #define KEY_IS_PRESSED(keycode) \
-    (kbdDevice->key->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
+    (inputInfo.keyboard->key->down[(keycode) >> 3] & (1 << ((keycode) & 7)))
 
 static void vncXConvertCase(KeySym sym, KeySym *lower, KeySym *upper);
 
-static DeviceIntPtr ptrDevice = NULL, kbdDevice = NULL;
+static DeviceIntPtr ptrDevice = NULL;
 
 
 void
 vncSetKeyboardDevice(DeviceIntPtr kbd)
 {
-   if (kbdDevice && kbd)
-      return; /* set once */
-   kbdDevice = kbd;
+  // obsoleted by inputInfo
 }
 
 
@@ -145,10 +143,7 @@ KbdAddEvent(Bool down, KeySym keySym, rf
     Bool shiftMustBeReleased = FALSE;
     Bool shiftMustBePressed = FALSE;
 
-    if (!kbdDevice)
-        return;
-
-    keySyms = XkbGetCoreMap(kbdDevice);
+    keySyms = XkbGetCoreMap(inputInfo.keyboard);
 
 #ifdef CORBA
     if (cl) {
@@ -259,40 +254,40 @@ KbdAddEvent(Bool down, KeySym keySym, rf
                shiftMustBePressed = TRUE;
        }
 
-       XkbApplyMappingChange(kbdDevice, keySyms, keyCode, 1, NULL, 
serverClient);
+       XkbApplyMappingChange(inputInfo.keyboard, keySyms, keyCode, 1, NULL, 
serverClient);
 
        ErrorF("KbdAddEvent: unknown KeySym 0x%x - allocating KeyCode %d\n",
               (int)keySym, keyCode);
     }
 
-    xkb = &kbdDevice->key->xkbInfo->state;
+    xkb = &inputInfo.keyboard->key->xkbInfo->state;
     if (down) {
        if (shiftMustBePressed && !(XkbStateFieldFromRec(xkb) & ShiftMask)) {
            fakeShiftPress = TRUE;
-            EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE);
+            EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_L_KEY_CODE);
        }
        if (shiftMustBeReleased && (XkbStateFieldFromRec(xkb) & ShiftMask)) {
            if (KEY_IS_PRESSED(SHIFT_L_KEY_CODE)) {
                fakeShiftLRelease = TRUE;
-                EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE);
+                EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_L_KEY_CODE);
            }
            if (KEY_IS_PRESSED(SHIFT_R_KEY_CODE)) {
                fakeShiftRRelease = TRUE;
-                EnqueueKey(kbdDevice, KeyRelease, SHIFT_R_KEY_CODE);
+                EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_R_KEY_CODE);
            }
        }
     }
 
-    EnqueueKey(kbdDevice, type, keyCode);
+    EnqueueKey(inputInfo.keyboard, type, keyCode);
 
     if (fakeShiftPress) {
-        EnqueueKey(kbdDevice, KeyRelease, SHIFT_L_KEY_CODE);
+        EnqueueKey(inputInfo.keyboard, KeyRelease, SHIFT_L_KEY_CODE);
     }
     if (fakeShiftLRelease) {
-        EnqueueKey(kbdDevice, KeyPress, SHIFT_L_KEY_CODE);
+        EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_L_KEY_CODE);
     }
     if (fakeShiftRRelease) {
-        EnqueueKey(kbdDevice, KeyPress, SHIFT_R_KEY_CODE);
+        EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_R_KEY_CODE);
     }
 }
 
@@ -343,15 +338,15 @@ KbdReleaseAllKeys(void)
 {
     int i, j;
 
-    if (!kbdDevice) 
+    if (!inputInfo.keyboard) 
        return;
 
     for (i = 0; i < DOWN_LENGTH; i++) {
-       if (kbdDevice->key->down[i] != 0) {
+       if (inputInfo.keyboard->key->down[i] != 0) {
            for (j = 0; j < 8; j++) {
-               if (kbdDevice->key->down[i] & (1 << j)) {
+               if (inputInfo.keyboard->key->down[i] & (1 << j)) {
                     int detail = (i << 3) | j;
-                    EnqueueKey(kbdDevice, KeyRelease, detail);
+                    EnqueueKey(inputInfo.keyboard, KeyRelease, detail);
                }
            }
        }
++++++ xorg-server-xf4vnc-bug605015-fix-keycode-lookup-and-isolevel3shift.diff 
++++++
This patch fixes keycode lookup (not using any static keyboard layout any more)
and ISO-Level3-Shift handling (enabling the use of keyboard layouts that use
AltGr for reaching certain characters).

Note that the implementation is still imperfect. Keyboard layouts that use a
different key than AltGr for ISO-Level3-Shift will show some weird behavior.
Mode_Switch is also not supported, so keyboard switching via Mode_Switch might
not work as intended either. Suggesting the use of input methods in these cases
(they will hopefully work).

mhopf - 21/04/2011

Index: xorg-server-1.9.3/hw/vnc/kbdptr.c
===================================================================
--- xorg-server-1.9.3.orig/hw/vnc/kbdptr.c
+++ xorg-server-1.9.3/hw/vnc/kbdptr.c
@@ -142,6 +142,10 @@ KbdAddEvent(Bool down, KeySym keySym, rf
     Bool fakeShiftRRelease = FALSE;
     Bool shiftMustBeReleased = FALSE;
     Bool shiftMustBePressed = FALSE;
+    Bool fakeLevel3Press = FALSE;
+    Bool fakeLevel3Release = FALSE;
+    Bool level3MustBeReleased = FALSE;
+    Bool level3MustBePressed = FALSE;
 
     keySyms = XkbGetCoreMap(inputInfo.keyboard);
 
@@ -161,6 +165,12 @@ KbdAddEvent(Bool down, KeySym keySym, rf
      *
      * Alan.
      */
+    /* Never use predefined keys.
+     * This is inherently incapable of dealing with changing
+     * keyboard layouts. Not being able to work with non-local xmodmaps
+     * is a nuisance at worst, and probably even preferred.
+     * 2011-04-15 [email protected] */
+#if 0
 #if !XFREE86VNC
     /* First check if it's one of our predefined keys.  If so then we can make
        some attempt at allowing an xmodmap inside a VNC desktop behave
@@ -187,6 +197,7 @@ KbdAddEvent(Bool down, KeySym keySym, rf
        }
     }
 #endif
+#endif
 
     if (!keyCode) {
 
@@ -201,18 +212,27 @@ KbdAddEvent(Bool down, KeySym keySym, rf
 
        for (i = 0; i < NO_OF_KEYS * keySyms->mapWidth; i++) {
            if (keySym == keySyms->map[i]) {
+               int j, numSyms = 0;
                keyCode = MIN_KEY_CODE + i / keySyms->mapWidth;
 
-               if (keySyms->map[(i / keySyms->mapWidth)
-                                       * keySyms->mapWidth + 1] != NoSymbol) {
-
+               for (j = 0; j < keySyms->mapWidth; j++)
+                   if (keySyms->map[(i / keySyms->mapWidth)
+                                       * keySyms->mapWidth + j] != NoSymbol)
+                       numSyms++;
+               if (numSyms > 1) {
                    /* this keycode has more than one symbol associated with
-                      it, so shift state is important */
+                      it, so shift/Level3_shift state is important */
 
-                   if ((i % keySyms->mapWidth) == 0)
+                   if (((i % keySyms->mapWidth) & 1) == 0)
                        shiftMustBeReleased = TRUE;
                    else
                        shiftMustBePressed = TRUE;
+                   /* Does NOT consider Mode_shift (entries 2-3) */
+                   if (((i % keySyms->mapWidth) & 4) == 0)
+                       level3MustBeReleased = TRUE;
+                   else {
+                       level3MustBePressed = TRUE;
+                   }
                }
                break;
            }
@@ -252,6 +272,7 @@ KbdAddEvent(Bool down, KeySym keySym, rf
                shiftMustBeReleased = TRUE;
            else
                shiftMustBePressed = TRUE;
+           level3MustBeReleased = TRUE;
        }
 
        XkbApplyMappingChange(inputInfo.keyboard, keySyms, keyCode, 1, NULL, 
serverClient);
@@ -262,6 +283,16 @@ KbdAddEvent(Bool down, KeySym keySym, rf
 
     xkb = &inputInfo.keyboard->key->xkbInfo->state;
     if (down) {
+       // TODO: would require to check which keycodes are actually
+       // bound to ISO_Level3_Shift and/or Shift_L
+       if (level3MustBePressed && !KEY_IS_PRESSED(ISO_LEVEL3_KEY_CODE)) {
+           fakeLevel3Press = TRUE;
+           EnqueueKey(inputInfo.keyboard, KeyPress, ISO_LEVEL3_KEY_CODE);
+       }
+       if (level3MustBeReleased && KEY_IS_PRESSED(ISO_LEVEL3_KEY_CODE)) {
+           fakeLevel3Release = TRUE;
+           EnqueueKey(inputInfo.keyboard, KeyRelease, ISO_LEVEL3_KEY_CODE);
+       }
        if (shiftMustBePressed && !(XkbStateFieldFromRec(xkb) & ShiftMask)) {
            fakeShiftPress = TRUE;
             EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_L_KEY_CODE);
@@ -289,6 +320,12 @@ KbdAddEvent(Bool down, KeySym keySym, rf
     if (fakeShiftRRelease) {
         EnqueueKey(inputInfo.keyboard, KeyPress, SHIFT_R_KEY_CODE);
     }
+    if (fakeLevel3Press) {
+        EnqueueKey(inputInfo.keyboard, KeyRelease, ISO_LEVEL3_KEY_CODE);
+    }
+    if (fakeLevel3Release) {
+        EnqueueKey(inputInfo.keyboard, KeyPress, ISO_LEVEL3_KEY_CODE);
+    }
 }
 
 
Index: xorg-server-1.9.3/hw/vnc/keyboard.h
===================================================================
--- xorg-server-1.9.3.orig/hw/vnc/keyboard.h
+++ xorg-server-1.9.3/hw/vnc/keyboard.h
@@ -32,6 +32,7 @@
 #define META_R_KEY_CODE                (MIN_KEY_CODE + 108)
 #define ALT_L_KEY_CODE         (MIN_KEY_CODE + 56)
 #define ALT_R_KEY_CODE         (MIN_KEY_CODE + 105)
+#define ISO_LEVEL3_KEY_CODE    ALT_R_KEY_CODE
 
 static KeySym map[MAX_KEY_CODE * GLYPHS_PER_KEY] = {
     /* 0x00 */  NoSymbol,       NoSymbol,      NoSymbol,       NoSymbol,

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to