Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 0be564e0dfb465f340200ec15f080d23 > files > 1

x11-driver-input-keyboard-1.1.1-1mdv2007.1.src.rpm

commit 05dd89ef03cee6853e7c2db518b6b22785cc3e7c
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Feb 5 14:29:54 2007 -0800

    Fix key led update
    
    Cf: https://bugs.freedesktop.org/show_bug.cgi?id=313
        https://bugs.freedesktop.org/attachment.cgi?id=8396&action=view
    
     ------- Comment  #8 From Samuel Thibault  2007-01-14 14:28:16  [reply] -------
    
    Created an attachment (id=8396) [details]
    fix key led update
    
    Ok, found the problem: when XKB is used (!pKbd->noXkb), pKbd->keyLeds is not
    updated, so that UpdateLeds(), even if it called at the right places, actually
    just clears all LEDs.  Here is a patch.

diff --git a/src/kbd.c b/src/kbd.c
index 7d402d5..24fe6f6 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -383,7 +383,22 @@ KbdCtrl( DeviceIntPtr device, KeybdCtrl *ctrl)
    InputInfoPtr pInfo = (InputInfoPtr) device->public.devicePrivate;
    KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
 
-   if ( ctrl->leds & XCOMP ) {
+   if ( ctrl->leds & XLED1) {
+       pKbd->keyLeds |= CAPSFLAG;
+   } else {
+       pKbd->keyLeds &= ~CAPSFLAG;
+   }
+   if ( ctrl->leds & XLED2) {
+       pKbd->keyLeds |= NUMFLAG;
+   } else {
+       pKbd->keyLeds &= ~NUMFLAG;
+   }
+   if ( ctrl->leds & XLED3) {
+       pKbd->keyLeds |= SCROLLFLAG;
+   } else {
+       pKbd->keyLeds &= ~SCROLLFLAG;
+   }
+   if ( ctrl->leds & (XCOMP|XLED4) ) {
        pKbd->keyLeds |= COMPOSEFLAG;
    } else {
        pKbd->keyLeds &= ~COMPOSEFLAG;