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

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Wed Dec 31 12:41:03 PST 2008


 hw/xquartz/X11Application.m |   11 +++--------
 hw/xquartz/darwinEvents.c   |   11 ++++++++---
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit cb912aca3a2834c4ad8e386c8a0d05c1bb31b0e7
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Dec 31 12:40:02 2008 -0800

    XQuartz: Don't use NX_SECONDARYFNMASK, NX_NUMERICPADMASK, NX_HELPMASK
    
    We don't have keycodes for them, so don't try to use them

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 4a4f7ab..50212dc 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -977,13 +977,6 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
     
     modifierFlags = [e modifierFlags];
     
-    /* These are the "only" modifier keys we care about */
-    modifierFlags &= (NX_COMMANDMASK | NX_CONTROLMASK | NX_ALTERNATEMASK | NX_SHIFTMASK |
-                      NX_SECONDARYFNMASK | NX_ALPHASHIFTMASK | NX_NUMERICPADMASK |
-                      NX_HELPMASK | NX_DEVICELCTLKEYMASK | NX_DEVICELSHIFTKEYMASK |
-                      NX_DEVICERSHIFTKEYMASK | NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK |
-                      NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK | NX_DEVICERCTLKEYMASK);
-    
 #ifdef NX_DEVICELCMDKEYMASK
     /* This is to workaround a bug in the VNC server where we sometimes see the L
      * modifier and sometimes see no "side"
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index c352310..4c388da 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -147,7 +147,6 @@ static void DarwinPressModifierKey(int pressed, int key) {
  */
 
 static int modifier_mask_list[] = {
-    NX_SECONDARYFNMASK, NX_NUMERICPADMASK, NX_HELPMASK,
 #ifdef NX_DEVICELCMDKEYMASK
     NX_DEVICELCTLKEYMASK, NX_DEVICERCTLKEYMASK,
     NX_DEVICELSHIFTKEYMASK, NX_DEVICERSHIFTKEYMASK,
@@ -164,6 +163,7 @@ static void DarwinUpdateModifiers(
     int flags )         // modifier flags that have changed
 {
     int *f;
+    int key;
 
     /* Capslock is special.  This mask is the state of capslock (on/off),
      * not the state of the button.  Hopefully we can find a better solution.
@@ -174,8 +174,13 @@ static void DarwinUpdateModifiers(
     }
     
     for(f=modifier_mask_list; *f; f++)
-        if(*f & flags)
-            DarwinPressModifierKey(pressed, DarwinModifierNXMaskToNXKey(*f));
+        if(*f & flags) {
+            key = DarwinModifierNXMaskToNXKey(*f);
+            if(key == -1)
+                ErrorF("DarwinUpdateModifiers: Unsupported NXMask: 0x%x\n", *f);
+            else
+                DarwinPressModifierKey(pressed, key);
+        }
 }
 
 /* Generic handler for Xquartz-specifc events.  When possible, these should
commit 3eef78eb321f4f7dbca5a10c80666c621e28a1e0
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Dec 31 11:57:49 2008 -0800

    XQuartz: Make sure to reset the saved key state when deactivating X11.app

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 90077fe..4a4f7ab 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -202,8 +202,10 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
 
         DarwinUpdateModKeys(0);
         for(i=0; i < NUM_KEYCODES; i++) {
-            if(keyState[i] == NSKeyDown)
+            if(keyState[i] == NSKeyDown) {
                 DarwinSendKeyboardEvents(KeyRelease, i);
+                keyState[i] = NSKeyUp;
+            }
         }
         
         DarwinSendDDXEvent(kXquartzDeactivate, 0);


More information about the xorg-commit mailing list