summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-12-07 15:03:10 -0800
committerAdam Jackson <ajax@redhat.com>2016-07-18 15:27:42 -0400
commit410bc047480a9f98df678dc850bc6b99c3cfb5bf (patch)
tree0fd0a0b846a5adc76e39e7a9570971e333ee8838 /hw
parent6299ef3d749d6f978d3d38d42f711ac56bf382eb (diff)
dmx: Eliminate use of AddEnabledDevice [v2]
Use SetNotifyFd instead, with the hope that someday someone will come fix this to be more efficient -- right now, the wakeup handler is doing the event reading, instead of the notify callback. v2: no need to patch dmxsigio.c as it has been removed. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/dmx/input/dmxcommon.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c
index 90154ef3e..c7aed68b7 100644
--- a/hw/dmx/input/dmxcommon.c
+++ b/hw/dmx/input/dmxcommon.c
@@ -480,17 +480,26 @@ dmxCommonXSelect(DMXScreenInfo * dmxScreen, void *closure)
return NULL;
}
+static void
+dmxCommonFdNotify(int fd, int ready, void *data)
+{
+ /* This should process input on this fd, but instead all
+ * of that is delayed until the block and wakeup handlers are called
+ */
+ ;
+}
+
static void *
dmxCommonAddEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
{
- AddEnabledDevice(XConnectionNumber(dmxScreen->beDisplay));
+ SetNotifyFd(XConnectionNumber(dmxScreen->beDisplay), dmxCommonFdNotify, X_NOTIFY_READ, closure);
return NULL;
}
static void *
dmxCommonRemoveEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
{
- RemoveEnabledDevice(XConnectionNumber(dmxScreen->beDisplay));
+ RemoveNotifyFd(XConnectionNumber(dmxScreen->beDisplay));
return NULL;
}
@@ -504,7 +513,7 @@ dmxCommonMouOn(DevicePtr pDev)
priv->eventMask |= DMX_POINTER_EVENT_MASK;
if (!priv->be) {
XSelectInput(priv->display, priv->window, priv->eventMask);
- AddEnabledDevice(XConnectionNumber(priv->display));
+ SetNotifyFd(XConnectionNumber(priv->display), dmxCommonFdNotify,X_NOTIFY_READ, pDev);
}
else {
dmxPropertyIterate(priv->be, dmxCommonXSelect, priv);
@@ -523,7 +532,7 @@ dmxCommonMouOff(DevicePtr pDev)
priv->eventMask &= ~DMX_POINTER_EVENT_MASK;
if (!priv->be) {
- RemoveEnabledDevice(XConnectionNumber(priv->display));
+ RemoveNotifyFd(XConnectionNumber(priv->display));
XSelectInput(priv->display, priv->window, priv->eventMask);
}
else {