[X2Go-Commits] nx-libs.git - build-main (branch) updated: nxcompshad/3.3.0-3

X2Go dev team git-admin at x2go.org
Fri Aug 30 16:22:19 CEST 2013


The branch, build-main has been updated
       via  3d8e85c4749ee9e55601f6e540311008bf8f77af (commit)
      from  3b4404668c6794f9d0665905f4e22c1a0fafac21 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 nxcompshad/CHANGELOG  |    5 +++++
 nxcompshad/Shadow.cpp |    3 +--
 nxcompshad/X11.cpp    |   60 +++++++++++++++++++++++++++++++++++++------------
 3 files changed, 52 insertions(+), 16 deletions(-)

The diff of changes is:
diff --git a/nxcompshad/CHANGELOG b/nxcompshad/CHANGELOG
index 79319b8..8678d21 100644
--- a/nxcompshad/CHANGELOG
+++ b/nxcompshad/CHANGELOG
@@ -1,5 +1,10 @@
 ChangeLog:
 
+nxcompshad-3.3.0-3
+
+- Fixed TR01G02158. Keymap initialization could be incorrect because
+  of a type mismatch on 64 bit platforms.
+
 nxcompshad-3.3.0-2
 
 - Updated VERSION.
diff --git a/nxcompshad/Shadow.cpp b/nxcompshad/Shadow.cpp
index c7fb6b4..f9154aa 100644
--- a/nxcompshad/Shadow.cpp
+++ b/nxcompshad/Shadow.cpp
@@ -466,6 +466,5 @@ void NXShadowInitKeymap(void *keysyms)
 {
   NXShadowKeymap = (KeySymsPtr) keysyms;
 
-  logTest("NXShadowInitKeymap","KeySyms pointer [0x%p] mapWidth [%d]",
-              (void *)NXShadowKeymap, NXShadowKeymap -> mapWidth);
+  logTest("NXShadowInitKeymap","KeySyms pointer [0x%p]", (void *)NXShadowKeymap);
 }
diff --git a/nxcompshad/X11.cpp b/nxcompshad/X11.cpp
index 3971c8e..99333b0 100644
--- a/nxcompshad/X11.cpp
+++ b/nxcompshad/X11.cpp
@@ -23,6 +23,7 @@
 #undef  DEBUG
 
 #include <X11/Xlibint.h>
+#include <X11/Xproto.h>
 #include <X11/extensions/XTest.h>
 #include <X11/keysym.h>
 #include <string.h>
@@ -59,6 +60,8 @@ static KeyPressedRec *shadowKeyPressedPtr = NULL;
 static KeySym *shadowKeysyms = NULL;
 static KeySym *masterKeysyms = NULL;
 
+static KeySym *shadowKeymap = NULL;
+
 static int shadowMinKey, shadowMaxKey, shadowMapWidth;
 static int masterMinKey, masterMaxKey, masterMapWidth;
 
@@ -409,12 +412,35 @@ void Poller::shmInit(void)
 
 void Poller::keymapShadowInit(Display *display)
 {
-  if (NXShadowKeymap)
+  int i, len;
+  CARD32 *map;
+
+  if (NXShadowKeymap != NULL)
   {
-    shadowMinKey = NXShadowKeymap -> minKeyCode;
-    shadowMaxKey = NXShadowKeymap -> maxKeyCode;
+    shadowMinKey   = NXShadowKeymap -> minKeyCode;
+    shadowMaxKey   = NXShadowKeymap -> maxKeyCode;
     shadowMapWidth = NXShadowKeymap -> mapWidth;
-    shadowKeysyms = NXShadowKeymap -> map;
+
+    len = (shadowMaxKey - shadowMinKey + 1) * shadowMapWidth;
+
+    map = (CARD32 *) NXShadowKeymap -> map;
+
+    if (shadowKeymap != NULL)
+    {
+      free(shadowKeymap);
+    }
+
+    shadowKeymap = (KeySym *) malloc(len * sizeof(KeySym));
+
+    if (shadowKeymap != NULL)
+    {
+      for (i = 0; i < len; i++)
+      {
+        shadowKeymap[i] = map[i];
+      }
+
+      shadowKeysyms = shadowKeymap;
+    }
   }
 
   if (shadowKeysyms == NULL)
@@ -426,13 +452,16 @@ void Poller::keymapShadowInit(Display *display)
   }
 
   #ifdef DEBUG
-  if (shadowKeysyms)
+  if (shadowKeysyms != NULL)
   {
-    for (int i = 0; i < (shadowMaxKey - shadowMinKey) * shadowMapWidth; i++)
+    for (i = 0; i < (shadowMaxKey - shadowMinKey + 1) * shadowMapWidth; i++)
     {
-      logDebug("Poller::keymapShadowInit", "keycode %d - keysym %x %s",
-                   (int)(i / shadowMapWidth), (unsigned int)shadowKeysyms[i],
-                       XKeysymToString(shadowKeysyms[i]));
+      if (i % shadowMapWidth == 0)
+      {
+        logDebug("Poller::keymapShadowInit", "keycode [%d]", (int) (i / shadowMapWidth));
+      }
+
+      logDebug("\tkeysym", " [%x] [%s]", (unsigned int) shadowKeysyms[i], XKeysymToString(shadowKeysyms[i]));
     }
   }
   #endif
@@ -446,13 +475,16 @@ void Poller::keymapMasterInit()
                                           &masterMapWidth);
 
   #ifdef DEBUG
-  if (masterKeysyms)
+  if (masterKeysyms != NULL)
   {
-    for (int i = 0; i < (masterMaxKey - masterMinKey) * masterMapWidth; i++)
+    for (int i = 0; i < (masterMaxKey - masterMinKey + 1) * masterMapWidth; i++)
     {
-      logDebug("Poller::keymapMasterInit", "keycode %d - keysym %x %s",
-                   (int)(i / masterMapWidth), (unsigned int)masterKeysyms[i],
-                       XKeysymToString(masterKeysyms[i]));
+      if (i % masterMapWidth == 0)
+      {
+        logDebug("Poller::keymapMasterInit", "keycode [%d]", (int) (i / masterMapWidth));
+      }
+
+      logDebug("\tkeysym", " [%x] [%s]", (unsigned int) masterKeysyms[i], XKeysymToString(masterKeysyms[i]));
     }
   }
   #endif


hooks/post-receive
-- 
nx-libs.git (NX (redistributed))

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nx-libs.git" (NX (redistributed)).




More information about the x2go-commits mailing list