Sent clipboard on a thread #4601

This commit is contained in:
Xinyu Hou
2015-05-20 19:53:30 +01:00
parent 49ac320f97
commit cf5347c8f6
4 changed files with 30 additions and 9 deletions

View File

@@ -79,7 +79,8 @@ Client::Client(
m_writeToDropDirThread(NULL),
m_socket(NULL),
m_useSecureNetwork(false),
m_args(args)
m_args(args),
m_sendClipboardThread(NULL)
{
assert(m_socketFactory != NULL);
assert(m_screen != NULL);
@@ -265,12 +266,11 @@ Client::leave()
m_active = false;
// send clipboards that we own and that have changed
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
if (m_ownClipboard[id]) {
sendClipboard(id);
}
}
m_sendClipboardThread = new Thread(
new TMethodJob<Client>(
this,
&Client::sendClipboardThread,
NULL));
return true;
}
@@ -750,6 +750,17 @@ Client::onFileRecieveCompleted()
}
}
void
Client::sendClipboardThread(void*)
{
// send clipboards that we own and that have changed
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
if (m_ownClipboard[id]) {
sendClipboard(id);
}
}
}
void
Client::handleStopRetry(const Event&, void*)
{