[Spice-devel] [PATCH xf86-video-qxl] Correct a long standing led state bug in XSpice.

Jeremy White jwhite at codeweavers.com
Fri Apr 5 14:38:31 UTC 2019


The CtrlProc for our keyboard driver incorrectly mapped
the device private to a SpiceKbd* intead of to a InputInfoPtr.

That resulted in led state being written into the driver name
for our driver structure, instead of into the led state.

That, in turn, led to a cool bug where if you pressed caps lock,
the two second sync timer in the spice server would cause it to
attempt to correct the state by pressing caps lock to get the
states to match.  Since the states will never match, the caps
lock effectively cycles on and off every two seconds.

Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
 src/spiceqxl_inputs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/spiceqxl_inputs.c b/src/spiceqxl_inputs.c
index b39eeae..5625309 100644
--- a/src/spiceqxl_inputs.c
+++ b/src/spiceqxl_inputs.c
@@ -138,9 +138,11 @@ static void xspice_keyboard_control(DeviceIntPtr device, KeybdCtrl *ctrl)
     };
 
     XSpiceKbd *kbd;
+    InputInfoPtr pInfo;
     int i;
 
-    kbd = device->public.devicePrivate;
+    pInfo = device->public.devicePrivate;
+    kbd = pInfo->private;
     kbd->ledstate = 0;
     for (i = 0; i < ArrayLength(bits); i++) {
         if (ctrl->leds & bits[i].xbit) {
-- 
2.11.0



More information about the Spice-devel mailing list