mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-11 14:15:46 +08:00
Attempt to fix problems with multimon windows. The mouse position
reported by the synergy hook dll is in a space with 0,0 in the upper-left which is not necessarily the same as the virtual desktop space. So the windows primary screen now accounts for that. On the secondary screen, mouse_event() doesn't seem to accept negative coordinates even on the windows NT family, making monitors with negative coordinates inaccessible via absolute moves. So if the move will be to negative coordinates, use the windows 95 family fallback of absolute moving to 0,0 then relative moving to the final position.
This commit is contained in:
@@ -310,8 +310,15 @@ CMSWindowsPrimaryScreen::onPreDispatch(const CEvent* event)
|
||||
m_y = static_cast<SInt32>(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(m_x, m_y);
|
||||
m_receiver->onMouseMovePrimary(x, y);
|
||||
}
|
||||
else {
|
||||
// motion on secondary screen. warp mouse back to
|
||||
|
||||
Reference in New Issue
Block a user