mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Clean up program flow - don't call PreInit for "modules" on DEVICE_INIT.
Call the PreInit functions for MB Emulation, wheel emu, and draglock during PreInit, not on DEVICE_INIT. This way, we only parse the options once and don't overwrite with defaults when coming back from a VT switch.
This commit is contained in:
@@ -320,15 +320,6 @@ EvdevMBEmuPreInit(InputInfoPtr pInfo)
|
||||
RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
|
||||
EvdevMBEmuWakeupHandler,
|
||||
(pointer)pInfo);
|
||||
|
||||
#ifdef HAVE_PROPERTIES
|
||||
XIChangeDeviceProperty(pInfo->dev, prop_mbemu, XA_INTEGER, 8,
|
||||
PropModeReplace, 1, &pEvdev->emulateMB.enabled,
|
||||
TRUE);
|
||||
XIChangeDeviceProperty(pInfo->dev, prop_mbtimeout, XA_INTEGER, 16,
|
||||
PropModeReplace, 1, &pEvdev->emulateMB.timeout,
|
||||
TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -308,25 +308,6 @@ EvdevWheelEmuPreInit(InputInfoPtr pInfo)
|
||||
"EmulateWheelInertia: %d, "
|
||||
"EmulateWheelTimeout: %d\n",
|
||||
pInfo->name, pEvdev->emulateWheel.button, inertia, timeout);
|
||||
|
||||
#ifdef HAVE_PROPERTIES
|
||||
XIChangeDeviceProperty(pInfo->dev, prop_wheel_emu, XA_INTEGER, 8,
|
||||
PropModeReplace, 1, &pEvdev->emulateWheel.enabled, TRUE);
|
||||
XIChangeDeviceProperty(pInfo->dev, prop_wheel_button, XA_INTEGER, 8,
|
||||
PropModeReplace, 1, &pEvdev->emulateWheel.button, TRUE);
|
||||
XIChangeDeviceProperty(pInfo->dev, prop_wheel_inertia, XA_INTEGER, 8,
|
||||
PropModeReplace, 1, &pEvdev->emulateWheel.inertia, TRUE);
|
||||
XIChangeDeviceProperty(pInfo->dev, prop_wheel_timeout, XA_INTEGER, 16,
|
||||
PropModeReplace, 1, &pEvdev->emulateWheel.timeout, TRUE);
|
||||
|
||||
val[0] = pEvdev->emulateWheel.X.up_button;
|
||||
val[1] = pEvdev->emulateWheel.X.down_button;
|
||||
val[2] = pEvdev->emulateWheel.Y.up_button;
|
||||
val[3] = pEvdev->emulateWheel.Y.down_button;
|
||||
XIChangeDeviceProperty(pInfo->dev, prop_wheel_axismap, XA_INTEGER, 8,
|
||||
PropModeReplace, 4, val, TRUE);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_PROPERTIES
|
||||
|
||||
11
src/evdev.c
11
src/evdev.c
@@ -1000,13 +1000,6 @@ EvdevOn(DeviceIntPtr device)
|
||||
} else
|
||||
{
|
||||
xf86AddEnabledDevice(pInfo);
|
||||
if ((pEvdev->flags & EVDEV_BUTTON_EVENTS) &&
|
||||
!(pEvdev->flags & EVDEV_INITIALIZED))
|
||||
{
|
||||
EvdevMBEmuPreInit(pInfo);
|
||||
EvdevWheelEmuPreInit(pInfo);
|
||||
EvdevDragLockInit(pInfo);
|
||||
}
|
||||
pEvdev->flags |= EVDEV_INITIALIZED;
|
||||
device->public.on = TRUE;
|
||||
}
|
||||
@@ -1367,6 +1360,10 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
||||
|
||||
EvdevCacheCompare(pInfo, FALSE); /* cache device data */
|
||||
|
||||
EvdevMBEmuPreInit(pInfo);
|
||||
EvdevWheelEmuPreInit(pInfo);
|
||||
EvdevDragLockInit(pInfo);
|
||||
|
||||
return pInfo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user