Send clipboard data in a thread #4601

This commit is contained in:
Jerry (Xinyu Hou) 2015-05-15 16:05:20 -07:00 committed by Xinyu Hou
parent 44089d55e8
commit 4c36c08099
4 changed files with 19 additions and 66 deletions

View file

@ -91,7 +91,8 @@ Server::Server(
m_ignoreFileTransfer(false),
m_enableDragDrop(enableDragDrop),
m_getDragInfoThread(NULL),
m_waitDragInfoThread(true)
m_waitDragInfoThread(true),
m_dataTransmissionThread(NULL)
{
// must have a primary client and it must have a canonical name
assert(m_primaryClient != NULL);
@ -505,9 +506,10 @@ Server::switchScreen(BaseClientProxy* dst,
forScreensaver);
// send the clipboard data to new active screen
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
m_active->setClipboard(id, &m_clipboards[id].m_clipboard);
}
m_dataTransmissionThread = new Thread(
new TMethodJob<Server>(
this, &Server::clipboardTransmissionThread,
NULL));
Server::SwitchToScreenInfo* info =
Server::SwitchToScreenInfo::alloc(m_active->getName());
@ -1849,6 +1851,14 @@ Server::sendDragInfo(BaseClientProxy* newScreen)
}
}
void
Server::clipboardTransmissionThread(void*)
{
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
m_active->setClipboard(id, &m_clipboards[id].m_clipboard);
}
}
void
Server::onMouseMoveSecondary(SInt32 dx, SInt32 dy)
{