From 4f418e015edfb241db3d74f417be6134e2269f8b Mon Sep 17 00:00:00 2001 From: crs Date: Thu, 20 Jun 2002 09:19:55 +0000 Subject: [PATCH] work around for bug with mouse driver on lombard powerbook. --- server/CXWindowsPrimaryScreen.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/server/CXWindowsPrimaryScreen.cpp b/server/CXWindowsPrimaryScreen.cpp index bbb9eefa..e5567393 100644 --- a/server/CXWindowsPrimaryScreen.cpp +++ b/server/CXWindowsPrimaryScreen.cpp @@ -187,8 +187,20 @@ CXWindowsPrimaryScreen::run() } while (!xevent.xmotion.send_event); } - // warp mouse back to center - if (x != 0 || y != 0) { + // warp mouse back to center. my lombard (powerbook + // g3) using the adbmouse driver has two problems: + // first, the driver only sends motions of +/-2 + // pixels and, second, it seems to discard some + // physical input after a warp. the former isn't a + // big deal (we're just limited to every other + // pixel) but the latter is a PITA. to work around + // it we only warp when the mouse has moved more + // than s_size pixels from the center. + static const SInt32 s_size = 32; + if (xevent.xmotion.x_root - m_xCenter < -s_size || + xevent.xmotion.x_root - m_xCenter > s_size || + xevent.xmotion.y_root - m_yCenter < -s_size || + xevent.xmotion.y_root - m_yCenter > s_size) { CDisplayLock display(this); // send an event that we can recognize before // the mouse warp.