summaryrefslogtreecommitdiffstats
path: root/usr.sbin/moused/moused.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-06-15 19:19:04 +0000
committermav <mav@FreeBSD.org>2010-06-15 19:19:04 +0000
commit597252854841710d6981f293f5bab6880df163b0 (patch)
tree049cddb77c07a525a17258e8d05fb4a044c0c204 /usr.sbin/moused/moused.c
parente645e40d6ba94b46f2d3e4191a81d1da090294a5 (diff)
downloadFreeBSD-src-597252854841710d6981f293f5bab6880df163b0.zip
FreeBSD-src-597252854841710d6981f293f5bab6880df163b0.tar.gz
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@
Diffstat (limited to 'usr.sbin/moused/moused.c')
-rw-r--r--usr.sbin/moused/moused.c3
1 files changed, 2 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud