diff options
-rw-r--r-- | hw/xfree86/common/xf86Events.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 9f3c76d44..772da89ba 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -301,29 +301,37 @@ xf86SigioReadInput(int fd, void *closure) } /* - * xf86AddEnabledDevice -- - * + * The host OS may or may not have working SIGIO handlers. If they don't, + * then the time_to_yield callback never gets called, and input will simply + * run out of the main loop whenever it gets around to it. */ + +static void +time_to_yield(int fd, void *closure) +{ + isItTimeToYield = 1; +} + void xf86AddEnabledDevice(InputInfoPtr pInfo) { - if (!xf86silkenMouseDisableFlag) + if (!xf86silkenMouseDisableFlag) { InputThreadRegisterDev(pInfo->fd, (void*) pInfo->read_input, pInfo); - else + } else { + xf86InstallSIGIOHandler(pInfo->fd, time_to_yield, NULL); AddEnabledDevice(pInfo->fd); + } } -/* - * xf86RemoveEnabledDevice -- - * - */ void xf86RemoveEnabledDevice(InputInfoPtr pInfo) { - if (!xf86silkenMouseDisableFlag) + if (!xf86silkenMouseDisableFlag) { InputThreadUnregisterDev(pInfo->fd); - else + } else { + xf86RemoveSIGIOHandler(pInfo->fd); RemoveEnabledDevice(pInfo->fd); + } } static int *xf86SignalIntercept = NULL; |