diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 84ea63345..fbbfc7352 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -195,6 +195,8 @@ void xf86DisableInputHandler(pointer handler); void xf86EnableInputHandler(pointer handler); pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data); int xf86RemoveGeneralHandler(pointer handler); +void xf86DisableGeneralHandler(pointer handler); +void xf86EnableGeneralHandler(pointer handler); void xf86InterceptSignals(int *signo); void xf86InterceptSigIll(void (*sigillhandler)(void)); Bool xf86EnableVTSwitch(Bool new); diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index e91b332a3..babe45b3e 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -742,6 +742,20 @@ xf86DisableInputHandler(pointer handler) RemoveEnabledDevice(ih->fd); } +_X_EXPORT void +xf86DisableGeneralHandler(pointer handler) +{ + IHPtr ih; + + if (!handler) + return; + + ih = handler; + ih->enabled = FALSE; + if (ih->fd >= 0) + RemoveGeneralSocket(ih->fd); +} + _X_EXPORT void xf86EnableInputHandler(pointer handler) { @@ -756,6 +770,20 @@ xf86EnableInputHandler(pointer handler) AddEnabledDevice(ih->fd); } +_X_EXPORT void +xf86EnableGeneralHandler(pointer handler) +{ + IHPtr ih; + + if (!handler) + return; + + ih = handler; + ih->enabled = TRUE; + if (ih->fd >= 0) + AddGeneralSocket(ih->fd); +} + /* * As used currently by the DRI, the return value is ignored. */