NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xsrc/56415: wskbd(4) mangled due to WSKBD_RAW after Xorg server crash



The following reply was made to PR xsrc/56415; it has been noted by GNATS.

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: xsrc/56415: wskbd(4) mangled due to WSKBD_RAW after Xorg server
	 crash
Date: Thu, 23 Sep 2021 22:10:43 +0900

 > >Number:         56415
 > >Category:       xsrc
 > >Synopsis:       wskbd(4) mangled due to WSKBD_RAW after Xorg server crash
  :
 > >Fix:
 > The following patch that adds DEVICE_ABORT to call Kbd_Off() works around
 > (at least on NetBSD/luna68k 9.2):
 > 
 > Index: external/mit/xf86-input-keyboard/dist/src/kbd.c
 > ===================================================================
 > RCS file: /cvsroot/xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c,v
 > retrieving revision 1.7
 > diff -u -p -d -r1.7 kbd.c
 > --- external/mit/xf86-input-keyboard/dist/src/kbd.c	5 Mar 2017 08:05:23 -0000	1.7
 > +++ external/mit/xf86-input-keyboard/dist/src/kbd.c	22 Sep 2021 13:29:50 -0000
 > @@ -384,6 +384,13 @@ KbdProc(DeviceIntPtr device, int what)
 >      device->public.on = FALSE;
 >      break;
 >  
 > +  case DEVICE_ABORT:
 > +    /*
 > +     * Restore original keyboard state even on crash.
 > +     */
 > +    pKbd->KbdOff(pInfo, what);
 > +    break;
 > +    
 >    default:
 >      return BadValue;
 >    }
 
 Per xf86-input-elographics, it would be better to add XINPUT API check:
  https://nxr.netbsd.org/xref/xsrc/external/mit/xf86-input-elographics/dist/src/xf86Elo.c?a=true&r=1.7#925
 
 ---
 Index: kbd.c
 ===================================================================
 RCS file: /cvsroot/xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c,v
 retrieving revision 1.7
 diff -u -p -d -r1.7 kbd.c
 --- kbd.c	5 Mar 2017 08:05:23 -0000	1.7
 +++ kbd.c	23 Sep 2021 12:52:43 -0000
 @@ -384,6 +384,15 @@ KbdProc(DeviceIntPtr device, int what)
      device->public.on = FALSE;
      break;
  
 +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 100 + GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 1901
 +  case DEVICE_ABORT:
 +    /*
 +     * Restore original keyboard state even on crash.
 +     */
 +    pKbd->KbdOff(pInfo, what);
 +    break;
 +#endif
 +
    default:
      return BadValue;
    }
 
 
 ---
 Izumi Tsutsui
 


Home | Main Index | Thread Index | Old Index