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

@ -92,7 +92,8 @@ Server::Server(
m_ignoreFileTransfer(false),
m_enableDragDrop(enableDragDrop),
m_getDragInfoThread(NULL),
m_waitDragInfoThread(true)
m_waitDragInfoThread(true),
m_sendClipboardThread(NULL)
{
// must have a primary client and it must have a canonical name
assert(m_primaryClient != NULL);
@ -505,6 +506,13 @@ Server::switchScreen(BaseClientProxy* dst,
m_primaryClient->getToggleMask(),
forScreensaver);
// send the clipboard data to new active screen
m_sendClipboardThread = new Thread(
new TMethodJob<Server>(
this,
&Server::sendClipboardThread,
NULL));
Server::SwitchToScreenInfo* info =
Server::SwitchToScreenInfo::alloc(m_active->getName());
m_events->addEvent(Event(m_events->forServer().screenSwitched(), this, info));