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:
parent
42040ff081
commit
ce304e0820
@ -1090,7 +1090,8 @@ moused(void)
|
|||||||
FD_SET(rodent.mremcfd, &fds);
|
FD_SET(rodent.mremcfd, &fds);
|
||||||
|
|
||||||
c = select(FD_SETSIZE, &fds, NULL, NULL,
|
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 */
|
if (c < 0) { /* error */
|
||||||
logwarn("failed to read from mouse");
|
logwarn("failed to read from mouse");
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user