From 3fc4f40b6c6cb416c9dc4bdb35c91b4f32c03ccc Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Sun, 12 Oct 2008 16:08:26 -0700 Subject: [PATCH] Restore xf86{Enable, Disable}GeneralHandler. These were useful as part of the generic handler ABI, and are used by the NVIDIA driver. This reverts part of commit 50081d2dfb79878cb931a15c265f0d60698dfd39. --- hw/xfree86/common/xf86.h | 2 ++ hw/xfree86/common/xf86Events.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) 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. */