Remove wakeup handlers when device is closed.

Less SIGABRTs are less exciting, but sometimes boredom is what we want.
This commit is contained in:
Peter Hutterer
2008-06-11 10:36:00 +09:30
parent 08ba40b253
commit 9591dc1f6c
3 changed files with 11 additions and 0 deletions

View File

@@ -299,6 +299,15 @@ EvdevMBEmuPreInit(InputInfoPtr pInfo)
}
void
EvdevMBEmuFinalize(InputInfoPtr pInfo)
{
RemoveBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
EvdevMBEmuWakeupHandler,
(pointer)pInfo);
}
/* Enable/disable middle mouse button emulation. */
void
EvdevMBEmuEnable(InputInfoPtr pInfo, BOOL enable)

View File

@@ -843,6 +843,7 @@ EvdevProc(DeviceIntPtr device, int what)
xf86Msg(X_WARNING, "%s: Release failed (%s)\n", pInfo->name,
strerror(errno));
xf86RemoveEnabledDevice(pInfo);
EvdevMBEmuFinalize(pInfo);
device->public.on = FALSE;
break;

View File

@@ -75,6 +75,7 @@ BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
void EvdevMBEmuWakeupHandler(pointer, int, pointer);
void EvdevMBEmuBlockHandler(pointer, struct timeval**, pointer);
void EvdevMBEmuPreInit(InputInfoPtr);
void EvdevMBEmuFinalize(InputInfoPtr);
void EvdevMBEmuEnable(InputInfoPtr, BOOL);
#endif