From 646e1b52ebfda11cbbe98ee65bc24be550928fb1 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 4 Jun 2015 13:09:48 -0700 Subject: [PATCH] Interrupted file transfer when cursor move back #4584 --- src/lib/client/Client.cpp | 10 ++++++++-- src/lib/server/Server.cpp | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index cff76da1..a8b3e3b3 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -257,6 +257,11 @@ Client::enter(SInt32 xAbs, SInt32 yAbs, UInt32, KeyModifierMask mask, bool) m_active = true; m_screen->mouseMove(xAbs, yAbs); m_screen->enter(mask); + + if (m_sendFileThread != NULL) { + StreamChunker::interruptFile(); + m_sendFileThread = NULL; + } } bool @@ -265,11 +270,12 @@ Client::leave() m_screen->leave(); m_active = false; - + if (m_sendClipboardThread != NULL) { StreamChunker::interruptClipboard(); + m_sendClipboardThread = NULL; } - + m_sendClipboardThread = new Thread( new TMethodJob( this, diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index d77e7a2c..440fe128 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -1797,7 +1797,7 @@ Server::onMouseMovePrimary(SInt32 x, SInt32 y) return false; } - + // switch screen switchScreen(newScreen, x, y, false); m_waitDragInfoThread = true; @@ -1993,6 +1993,11 @@ Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy) } while (false); if (jump) { + if (m_sendFileThread != NULL) { + StreamChunker::interruptFile(); + m_sendFileThread = NULL; + } + // switch screens switchScreen(newScreen, m_x, m_y, false); }