[PATCH 04/54] AllocDevicePair: Ensure XKB privates are initialised

Daniel Stone daniel at fooishbar.org
Mon Jul 9 18:02:48 PDT 2012


Since we call directly into XKB and may be doing so before the extension
has been initialised, make sure its privates are set up first.  XTest
had a hack to do this itself, but seems cleaner to just make sure we do
it in AllocDevicePair.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>
---
 dix/devices.c |    2 ++
 test/xtest.c  |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dix/devices.c b/dix/devices.c
index 70fb273..4200064 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2656,6 +2656,8 @@ AllocDevicePair(ClientPtr client, const char *name,
 
     *ptr = *keybd = NULL;
 
+    XkbInitPrivates();
+
     pointer = AddInputDevice(client, ptr_proc, TRUE);
 
     if (!pointer)
diff --git a/test/xtest.c b/test/xtest.c
index 99e2185..402d9ce 100644
--- a/test/xtest.c
+++ b/test/xtest.c
@@ -76,8 +76,6 @@ xtest_init_devices(void)
     InitAtoms();
     SyncExtensionInit();
 
-    XkbInitPrivates();
-
     /* this also inits the xtest devices */
     InitCoreDevices();
 
-- 
1.7.10.4



More information about the xorg-devel mailing list