When Emulate3Button is active, do not set select() timeout in states when

it is not needed. No need to kick CPU every 20ms without a purpose.

Reviewed by:	philip@
This commit is contained in:
mav 2010-06-15 19:19:04 +00:00
parent e645e40d6b
commit 5972528548

View File

@ -1090,7 +1090,8 @@ moused(void)
FD_SET(rodent.mremcfd, &fds);
c = select(FD_SETSIZE, &fds, NULL, NULL,
(rodent.flags & Emulate3Button) ? &timeout : NULL);
((rodent.flags & Emulate3Button) &&
S_DELAYED(mouse_button_state)) ? &timeout : NULL);
if (c < 0) { /* error */
logwarn("failed to read from mouse");
continue;