diff options
author | Keith Packard <keithp@keithp.com> | 2000-10-06 05:54:09 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2000-10-06 05:54:09 +0000 |
commit | fae164a4958b95e3ba4e4d5125da4611fcb14f6d (patch) | |
tree | 8406f37989e1b7c96b05776e1d35a54160e428aa | |
parent | b814019be970bc45f808ec19eef0a48b789d6646 (diff) |
kdrive: ignore mouse/keyboard fds in WakeupHandler while switched away
-rw-r--r-- | hw/kdrive/src/kinput.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index dd1b9a38e..0b380c19d 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -1323,30 +1323,34 @@ KdBlockHandler (int screen, void KdWakeupHandler (int screen, pointer data, - unsigned long result, + unsigned long lresult, pointer readmask) { + int result = (int) lresult; fd_set *pReadmask = (fd_set *) readmask; - if (kdMouseFd >= 0 && FD_ISSET (kdMouseFd, pReadmask)) + if (kdInputEnabled && result > 0) { - KdBlockSigio (); - (*kdMouseFuncs->Read) (kdMouseFd); - KdUnblockSigio (); - } + if (kdMouseFd >= 0 && FD_ISSET (kdMouseFd, pReadmask)) + { + KdBlockSigio (); + (*kdMouseFuncs->Read) (kdMouseFd); + KdUnblockSigio (); + } #ifdef TOUCHSCREEN - if (kdTsFd >= 0 && FD_ISSET (kdTsFd, pReadmask)) - { - KdBlockSigio (); - (*kdTsFuncs->Read) (kdTsFd); - KdUnblockSigio (); - } + if (kdTsFd >= 0 && FD_ISSET (kdTsFd, pReadmask)) + { + KdBlockSigio (); + (*kdTsFuncs->Read) (kdTsFd); + KdUnblockSigio (); + } #endif - if (kdKeyboardFd >= 0 && FD_ISSET (kdKeyboardFd, pReadmask)) - { - KdBlockSigio (); - (*kdKeyboardFuncs->Read) (kdKeyboardFd); - KdUnblockSigio (); + if (kdKeyboardFd >= 0 && FD_ISSET (kdKeyboardFd, pReadmask)) + { + KdBlockSigio (); + (*kdKeyboardFuncs->Read) (kdKeyboardFd); + KdUnblockSigio (); + } } if (kdTimeoutPending) { @@ -1370,7 +1374,7 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) if (kdDisableZaphod || screenInfo.numScreens <= 1) return FALSE; - if (*x < 0) + if (*x < 0 || *y < 0) { n = pScreen->myNum - 1; if (n < 0) @@ -1380,7 +1384,7 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) *ppScreen = pScreen; return TRUE; } - else if (*x >= pScreen->width) + else if (*x >= pScreen->width || *y >= pScreen->height) { n = pScreen->myNum + 1; if (n >= screenInfo.numScreens) |