If a device was enabled before the VT switch, re-enabled it. Otherwise leave it as is, there was probably a reason why it was disabled.
Signed-off-by: Peter Hutterer <[email protected]> --- bit of a hack, we could store this in the device struct but this approach is sufficient. Note that this only affects xfree86 devices, virtual devices (master devices) are enabled anyway. hw/xfree86/common/xf86Events.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 058057e..c56243e 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -415,6 +415,7 @@ xf86VTSwitch(void) static int prevSIGIO; InputInfoPtr pInfo; IHPtr ih; + static char device_was_enabled[MAXDEVICES]; DebugF("xf86VTSwitch()\n"); @@ -449,6 +450,7 @@ xf86VTSwitch(void) xf86DisableInputHandler(ih); for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) { if (pInfo->dev) { + device_was_enabled[pInfo->dev->id] = pInfo->dev->enabled; xf86ReleaseKeys(pInfo->dev); ProcessInputEvents(); DisableDevice(pInfo->dev, TRUE); @@ -482,7 +484,7 @@ xf86VTSwitch(void) pInfo = xf86InputDevs; while (pInfo) { - if (pInfo->dev) + if (pInfo->dev && device_was_enabled[pInfo->dev->id]) EnableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } @@ -537,7 +539,7 @@ xf86VTSwitch(void) pInfo = xf86InputDevs; while (pInfo) { - if (pInfo->dev) + if (pInfo->dev && device_was_enabled[pInfo->dev->id]) EnableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } -- 1.7.10 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
