diff --git a/src/lib/platform/CMSWindowsScreen.cpp b/src/lib/platform/CMSWindowsScreen.cpp index 977d4119..6a5b5f4a 100644 --- a/src/lib/platform/CMSWindowsScreen.cpp +++ b/src/lib/platform/CMSWindowsScreen.cpp @@ -359,7 +359,6 @@ CMSWindowsScreen::leave() forceShowCursor(); if (m_draggingStarted) { - fakeMouseButton(kButtonLeft, false); m_draggingStarted = false; } diff --git a/src/lib/server/CServer.cpp b/src/lib/server/CServer.cpp index a0335d00..eb50e540 100644 --- a/src/lib/server/CServer.cpp +++ b/src/lib/server/CServer.cpp @@ -1741,6 +1741,11 @@ CServer::onMouseMovePrimary(SInt32 x, SInt32 y) // should we switch or not? if (isSwitchOkay(newScreen, dir, x, y, xc, yc)) { if (m_screen->getDraggingStarted() && m_active != newScreen) { + // fake a escape key down and up then left mouse button up + m_screen->keyDown(kKeyEscape, 8192, 1); + m_screen->keyUp(kKeyEscape, 8192, 1); + m_screen->mouseUp(kButtonLeft); + CString& dragFileList = m_screen->getDraggingFileDir(); size_t size = dragFileList.size() + 1; char* fileList = new char[size]; diff --git a/src/lib/synergy/CScreen.cpp b/src/lib/synergy/CScreen.cpp index 995c9df1..e06c14d9 100644 --- a/src/lib/synergy/CScreen.cpp +++ b/src/lib/synergy/CScreen.cpp @@ -186,8 +186,6 @@ CScreen::screensaver(bool activate) void CScreen::keyDown(KeyID id, KeyModifierMask mask, KeyButton button) { - assert(!m_isPrimary || m_fakeInput); - // check for ctrl+alt+del emulation if (id == kKeyDelete && (mask & (KeyModifierControl | KeyModifierAlt)) == @@ -211,21 +209,18 @@ CScreen::keyRepeat(KeyID id, void CScreen::keyUp(KeyID, KeyModifierMask, KeyButton button) { - assert(!m_isPrimary || m_fakeInput); m_screen->fakeKeyUp(button); } void CScreen::mouseDown(ButtonID button) { - assert(!m_isPrimary); m_screen->fakeMouseButton(button, true); } void CScreen::mouseUp(ButtonID button) { - assert(!m_isPrimary); m_screen->fakeMouseButton(button, false); } @@ -372,16 +367,14 @@ CScreen::isLockedToScreen() const { // check for pressed mouse buttons // HACK: commented out as it breaks new drag drop feature -// UInt32 buttonID = 0; -// if (m_screen->isAnyMouseButtonDown(buttonID)) { -// LOG((CLOG_DEBUG "locked by mouse buttonID: %d", buttonID)); -// if (buttonID == kButtonLeft) { -// // TODO: fake esc key down and up -// //m_screen->fakeMouseButton(buttonID, false); -// } -// -// return (buttonID == kButtonLeft) ? false : true; -// } + UInt32 buttonID = 0; + if (m_screen->isAnyMouseButtonDown(buttonID)) { + if (buttonID != kButtonLeft) { + LOG((CLOG_DEBUG "locked by mouse buttonID: %d", buttonID)); + } + + return (buttonID == kButtonLeft) ? false : true; + } // not locked return false;