kdrive: ignore mouse/keyboard fds in WakeupHandler while switched away

This commit is contained in:
Keith Packard 2000-10-06 05:54:09 +00:00
parent b814019be9
commit fae164a495

View File

@ -1323,11 +1323,14 @@ KdBlockHandler (int screen,
void void
KdWakeupHandler (int screen, KdWakeupHandler (int screen,
pointer data, pointer data,
unsigned long result, unsigned long lresult,
pointer readmask) pointer readmask)
{ {
int result = (int) lresult;
fd_set *pReadmask = (fd_set *) readmask; fd_set *pReadmask = (fd_set *) readmask;
if (kdInputEnabled && result > 0)
{
if (kdMouseFd >= 0 && FD_ISSET (kdMouseFd, pReadmask)) if (kdMouseFd >= 0 && FD_ISSET (kdMouseFd, pReadmask))
{ {
KdBlockSigio (); KdBlockSigio ();
@ -1348,6 +1351,7 @@ KdWakeupHandler (int screen,
(*kdKeyboardFuncs->Read) (kdKeyboardFd); (*kdKeyboardFuncs->Read) (kdKeyboardFd);
KdUnblockSigio (); KdUnblockSigio ();
} }
}
if (kdTimeoutPending) if (kdTimeoutPending)
{ {
if ((long) (GetTimeInMillis () - kdEmulationTimeout) >= 0) if ((long) (GetTimeInMillis () - kdEmulationTimeout) >= 0)
@ -1370,7 +1374,7 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
if (kdDisableZaphod || screenInfo.numScreens <= 1) if (kdDisableZaphod || screenInfo.numScreens <= 1)
return FALSE; return FALSE;
if (*x < 0) if (*x < 0 || *y < 0)
{ {
n = pScreen->myNum - 1; n = pScreen->myNum - 1;
if (n < 0) if (n < 0)
@ -1380,7 +1384,7 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
*ppScreen = pScreen; *ppScreen = pScreen;
return TRUE; return TRUE;
} }
else if (*x >= pScreen->width) else if (*x >= pScreen->width || *y >= pScreen->height)
{ {
n = pScreen->myNum + 1; n = pScreen->myNum + 1;
if (n >= screenInfo.numScreens) if (n >= screenInfo.numScreens)