From 597252854841710d6981f293f5bab6880df163b0 Mon Sep 17 00:00:00 2001 From: mav Date: Tue, 15 Jun 2010 19:19:04 +0000 Subject: 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@ --- usr.sbin/moused/moused.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.sbin') diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index f647f43..47b2541 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -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; -- cgit v1.1