Subvert SIGUSR2 to reload all input devices. (Ubuntu #020)

This commit is contained in:
Daniel Stone 2005-08-26 07:35:55 +00:00
parent 89c84575ea
commit 3075df24e7
2 changed files with 21 additions and 0 deletions

View File

@ -1735,6 +1735,26 @@ XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex,
#endif /* XTESTEXT1 */ #endif /* XTESTEXT1 */
void
xf86ReloadInputDevs(int sig)
{
InputInfoPtr pInfo;
signal(sig, (void(*)(int))xf86ReloadInputDevs);
DisableDevice((DeviceIntPtr)xf86Info.pKeyboard);
EnableDevice((DeviceIntPtr)xf86Info.pKeyboard);
pInfo = xf86InputDevs;
while (pInfo) {
DisableDevice(pInfo->dev);
EnableDevice(pInfo->dev);
pInfo = pInfo->next;
}
return;
}
#ifdef WSCONS_SUPPORT #ifdef WSCONS_SUPPORT
/* XXX Currently XKB is mandatory. */ /* XXX Currently XKB is mandatory. */

View File

@ -289,6 +289,7 @@ xf86OpenConsole(void)
} else { /* ShareVTs */ } else { /* ShareVTs */
close(xf86Info.consoleFd); close(xf86Info.consoleFd);
} }
signal(SIGUSR2, xf86ReloadInputDevs);
} else { /* serverGeneration != 1 */ } else { /* serverGeneration != 1 */
if (!ShareVTs && VTSwitch) if (!ShareVTs && VTSwitch)
{ {