xserver: Branch 'xorg-server-1.7-apple' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Thu Oct 1 12:49:44 PDT 2009


 hw/xquartz/bundle/Info.plist.cpp |    4 +--
 hw/xquartz/mach-startup/stub.c   |    2 -
 hw/xquartz/quartzKeyboard.c      |   48 +++++++++++++++++++++++++++++++++------
 3 files changed, 44 insertions(+), 10 deletions(-)

New commits:
commit dfcfd04a73aaad353e9a74539a45e6c20072d5bc
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu Oct 1 11:58:18 2009 -0700

    XQuartz: Update version strings to be X11R7.5 and the bundle 2.5.0
    
    Is fink really _still_ relying on this X11R7.x version string?
    (cherry picked from commit 3d7cf468df96c0130a862f0d93fec990b9110c2f)

diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index d385e07..87214f4 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -19,9 +19,9 @@
 	<key>CFBundlePackageType</key>
 		<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-		<string>2.4.0</string>
+		<string>2.5.0</string>
 	<key>CFBundleVersion</key>
-		<string>2.4.0</string>
+		<string>2.5.0</string>
 	<key>CFBundleSignature</key>
 		<string>x11a</string>
 	<key>CSResourcesFileMapped</key>
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index 3d22db5..8f67035 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -205,7 +205,7 @@ int main(int argc, char **argv, char **envp) {
     sig_t handler;
 
     if(argc == 2 && !strcmp(argv[1], "-version")) {
-        fprintf(stderr, "X.org Release 7.4\n");
+        fprintf(stderr, "X.org Release 7.5\n");
         fprintf(stderr, "X.Org X Server %s\n", XSERVER_VERSION);
         fprintf(stderr, "Build Date: %s\n", BUILD_DATE);
         return EXIT_SUCCESS;
commit 02d7f94676d175defe14a8d4f8d27a8b162754b4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Sep 30 00:22:02 2009 -0700

    XQuartz: Set the proper bitmap for key repeats...
    
    XkbSetRepeatKeys lies and doesn't do what it says it will...
    (cherry picked from commit 873467adad479be02cd9cc6b43685919f5612d91)

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index ea0ebe5..06b981e 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -304,19 +304,53 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
 /* Set the repeat rates based on global preferences and keycodes for modifiers.
  * Precondition: Has the keyInfo_mutex lock.
  */
-static void DarwinKeyboardSetRepeat(DeviceIntPtr pDev, CFIndex initialKeyRepeatValue, CFIndex keyRepeatValue) {
+static void DarwinKeyboardSetRepeat(DeviceIntPtr pDev, int initialKeyRepeatValue, int keyRepeatValue) {
     if(initialKeyRepeatValue == 300000) { // off
+        /* Turn off repeats globally */
         XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOff);
     } else {
-        pDev->key->xkbInfo->desc->ctrls->repeat_delay = initialKeyRepeatValue * 15;
-        pDev->key->xkbInfo->desc->ctrls->repeat_interval = keyRepeatValue * 15;
+        int i;
+        XkbControlsPtr      ctrl;
+        XkbControlsRec      old;
 
+        /* Turn on repeats globally */
         XkbSetRepeatKeys(pDev, -1, AutoRepeatModeOn);
+        
+        /* Setup the bit mask for individual key repeats */
+        ctrl = pDev->key->xkbInfo->desc->ctrls;
+        old= *ctrl;
+        
+        ctrl->repeat_delay = initialKeyRepeatValue * 15;
+        ctrl->repeat_interval = keyRepeatValue * 15;
+
+        /* Turn off key-repeat for modifier keys, on for others */
+        /* First set them all on */
+        for(i=0; i < XkbPerKeyBitArraySize; i++)
+            ctrl->per_key_repeat[i] = -1;
+
+        /* Now turn off the modifiers */
+        for(i=0; i < 32; i++) {
+            unsigned char keycode;
+            
+            keycode = keyInfo.modifierKeycodes[i][0];
+            if(keycode)
+                ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
+
+            keycode = keyInfo.modifierKeycodes[i][1];
+            if(keycode)
+                ClearBit(ctrl->per_key_repeat, keycode + MIN_KEYCODE);
+        }
+
+        /* Hurray for data duplication */
+        if (pDev->kbdfeed)
+            memcpy(pDev->kbdfeed->ctrl.autoRepeats, ctrl->per_key_repeat, XkbPerKeyBitArraySize);
+
+        //fprintf(stderr, "per_key_repeat =\n");
+        //for(i=0; i < XkbPerKeyBitArraySize; i++)
+        //    fprintf(stderr, "%02x%s", ctrl->per_key_repeat[i], (i + 1) & 7 ? "" : "\n");
 
-        /* TODO: Turn off key-repeat for modifier keys, on for others */
-        // Test: Shouldn't this turn off all the key repeats???
-        //for(i=MIN_KEYCODE; i <= MAX_KEYCODE; i++)
-        //    XkbSetRepeatKeys(pDev, i, AutoRepeatModeOff);
+        /* And now we notify the puppies about the changes */
+        XkbDDXChangeControls(pDev, &old, ctrl);
     }
 }
 


More information about the xorg-commit mailing list