Some key repeats do not work without XKB

Pierre Ossman ossman at cendio.se
Fri Apr 24 07:23:36 PDT 2009


Another delightful bug when XKB is disabled. If you feed the core only
repeated KeyPress events, it's supposed to generate KeyRelease events
automatically. Unfortunately that code is broken and generates an
incorrect list of events.

Problems exists in 1.5 and 1.6.

Patch:

--- dix/getevents.c.orig	2009-04-24 16:16:44.000000000 +0200
+++ dix/getevents.c	2009-04-24 16:19:20.000000000 +0200
@@ -406,6 +406,7 @@ GetKeyboardValuatorEvents(xEvent *events
                           int key_code, int first_valuator,
                           int num_valuators, int *valuators) {
     int numEvents = 0;
+    int numReleaseEvents;
     CARD32 ms = 0;
     KeySym *map = pDev->key->curKeySyms.map;
     KeySym sym;
@@ -470,11 +471,13 @@ GetKeyboardValuatorEvents(xEvent *events
         if (noXkbExtension)
 #endif
         {
-            numEvents += GetKeyboardValuatorEvents(events, pDev,
-                                                   KeyRelease, key_code,
-                                                   first_valuator, num_valuators,
-                                                   valuators);
-            events += numEvents;
+            numReleaseEvents = GetKeyboardValuatorEvents(events, pDev,
+                                                         KeyRelease, key_code,
+                                                         first_valuator,
+                                                         num_valuators,
+                                                         valuators);
+            numEvents += numReleaseEvents;
+            events += numReleaseEvents;
         }
     }
 


-- 
Pierre Ossman            OpenSource-based Thin Client Technology
System Developer         Telephone: +46-13-21 46 00
Cendio AB                Web: http://www.cendio.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20090424/59ffaee5/attachment.pgp 


More information about the xorg-devel mailing list