diff --git a/lib/platform/CMSWindowsPrimaryScreen.cpp b/lib/platform/CMSWindowsPrimaryScreen.cpp index 990120d4..0e036a04 100644 --- a/lib/platform/CMSWindowsPrimaryScreen.cpp +++ b/lib/platform/CMSWindowsPrimaryScreen.cpp @@ -310,13 +310,6 @@ CMSWindowsPrimaryScreen::onPreDispatch(const CEvent* event) m_y = static_cast(msg->lParam); if (!isActive()) { - // shift by origin of virtual screen. the synergy - // hook DLL does not account for - SInt32 w, h; - m_screen->getShape(x, y, w, h); - x += m_x; - y += m_y; - // motion on primary screen m_receiver->onMouseMovePrimary(x, y); } diff --git a/lib/platform/CMSWindowsSecondaryScreen.cpp b/lib/platform/CMSWindowsSecondaryScreen.cpp index e680b9ba..35b4e5d0 100644 --- a/lib/platform/CMSWindowsSecondaryScreen.cpp +++ b/lib/platform/CMSWindowsSecondaryScreen.cpp @@ -357,6 +357,7 @@ CMSWindowsSecondaryScreen::warpCursor(SInt32 x, SInt32 y) // motion is simple (i.e. it's on the primary monitor) if there // is only one monitor. bool simple = !m_screen->isMultimon(); +/* disable attempts to use simple motion with multiple monitors for now if (!simple) { // also simple if motion is within the primary monitor simple = (x >= 0 && x < GetSystemMetrics(SM_CXSCREEN) && @@ -374,6 +375,7 @@ CMSWindowsSecondaryScreen::warpCursor(SInt32 x, SInt32 y) simple = (x0 == 0 && y0 == 0); } } +*/ // move the mouse directly to target position on NT family or if // not using multiple monitors. diff --git a/lib/platform/CSynergyHook.cpp b/lib/platform/CSynergyHook.cpp index 60590f3d..b5824efb 100644 --- a/lib/platform/CSynergyHook.cpp +++ b/lib/platform/CSynergyHook.cpp @@ -209,20 +209,28 @@ mouseHook(int code, WPARAM wParam, LPARAM lParam) hideCursor(thread); } + // get position. it seems the positions are not + // in virtual desktop coordinates but in a similar + // space with 0,0 at the upper-left. translate + // into virtual desktop coordinates. + SInt32 x = (SInt32)info->pt.x + g_xScreen; + SInt32 y = (SInt32)info->pt.y + g_yScreen; + // relay the motion - SInt32 x = (SInt32)info->pt.x; - SInt32 y = (SInt32)info->pt.y; PostThreadMessage(g_threadID, SYNERGY_MSG_MOUSE_MOVE, x, y); } return 1; } } else { - // check for mouse inside jump zone + // check for mouse inside jump zone. it seems the positions + // are not in virtual desktop coordinates but in a similar + // space with 0,0 at the upper-left. translate into virtual + // desktop coordinates. bool inside = false; const MOUSEHOOKSTRUCT* info = (const MOUSEHOOKSTRUCT*)lParam; - SInt32 x = (SInt32)info->pt.x; - SInt32 y = (SInt32)info->pt.y; + SInt32 x = (SInt32)info->pt.x + g_xScreen; + SInt32 y = (SInt32)info->pt.y + g_yScreen; if (!inside && (g_zoneSides & kLeftMask) != 0) { inside = (x < g_xScreen + g_zoneSize); }