From 9314e64ce35a8e46b20898d72cb9f99f01d811a7 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Thu, 26 Feb 2015 00:27:57 -0500 Subject: [PATCH 1/2] Drag/drop enabling is configurable in the GUI. --- src/gui/res/ServerConfigDialogBase.ui | 21 ++++++++++++++------- src/gui/src/MainWindow.cpp | 4 +++- src/gui/src/ServerConfig.cpp | 3 +++ src/gui/src/ServerConfig.h | 3 +++ src/gui/src/ServerConfigDialog.cpp | 3 +++ 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/gui/res/ServerConfigDialogBase.ui b/src/gui/res/ServerConfigDialogBase.ui index 6d257ba2..cc44f66e 100644 --- a/src/gui/res/ServerConfigDialogBase.ui +++ b/src/gui/res/ServerConfigDialogBase.ui @@ -491,7 +491,21 @@ Double click on a screen to edit its settings. + + + + Ignore auto config clients + + + + + + Enable drag and drop file transfers + + + + Qt::Vertical @@ -504,13 +518,6 @@ Double click on a screen to edit its settings. - - - - Ignore auto config clients - - - diff --git a/src/gui/src/MainWindow.cpp b/src/gui/src/MainWindow.cpp index b5b0ce11..0c6a60a4 100644 --- a/src/gui/src/MainWindow.cpp +++ b/src/gui/src/MainWindow.cpp @@ -442,7 +442,9 @@ void MainWindow::startSynergy() #ifndef Q_OS_LINUX - args << "--enable-drag-drop"; + if (m_ServerConfig.enableDragAndDrop()) { + args << "--enable-drag-drop"; + } #endif diff --git a/src/gui/src/ServerConfig.cpp b/src/gui/src/ServerConfig.cpp index 693e26b8..01b52d80 100644 --- a/src/gui/src/ServerConfig.cpp +++ b/src/gui/src/ServerConfig.cpp @@ -50,6 +50,7 @@ ServerConfig::ServerConfig(QSettings* settings, int numColumns, int numRows , m_NumRows(numRows), m_ServerName(serverName), m_IgnoreAutoConfigClient(false), + m_EnableDragAndDrop(false), m_pMainWindow(mainWindow) { Q_ASSERT(m_pSettings); @@ -114,6 +115,7 @@ void ServerConfig::saveSettings() settings().setValue("switchDoubleTap", switchDoubleTap()); settings().setValue("switchCornerSize", switchCornerSize()); settings().setValue("ignoreAutoConfigClient", ignoreAutoConfigClient()); + settings().setValue("enableDragAndDrop", enableDragAndDrop()); writeSettings(settings(), switchCorners(), "switchCorner"); @@ -157,6 +159,7 @@ void ServerConfig::loadSettings() setSwitchDoubleTap(settings().value("switchDoubleTap", 250).toInt()); setSwitchCornerSize(settings().value("switchCornerSize").toInt()); setIgnoreAutoConfigClient(settings().value("ignoreAutoConfigClient").toBool()); + setEnableDragAndDrop(settings().value("enableDragAndDrop", true).toBool()); readSettings(settings(), switchCorners(), "switchCorner", false, NumSwitchCorners); diff --git a/src/gui/src/ServerConfig.h b/src/gui/src/ServerConfig.h index 2a9d0646..b8cba139 100644 --- a/src/gui/src/ServerConfig.h +++ b/src/gui/src/ServerConfig.h @@ -61,6 +61,7 @@ class ServerConfig : public BaseConfig const QList& switchCorners() const { return m_SwitchCorners; } const HotkeyList& hotkeys() const { return m_Hotkeys; } bool ignoreAutoConfigClient() const { return m_IgnoreAutoConfigClient; } + bool enableDragAndDrop() const { return m_EnableDragAndDrop; } void saveSettings(); void loadSettings(); @@ -88,6 +89,7 @@ class ServerConfig : public BaseConfig void setSwitchCorner(int c, bool on) { m_SwitchCorners[c] = on; } void setSwitchCornerSize(int val) { m_SwitchCornerSize = val; } void setIgnoreAutoConfigClient(bool on) { m_IgnoreAutoConfigClient = on; } + void setEnableDragAndDrop(bool on) { m_EnableDragAndDrop = on; } QList& switchCorners() { return m_SwitchCorners; } HotkeyList& hotkeys() { return m_Hotkeys; } @@ -119,6 +121,7 @@ class ServerConfig : public BaseConfig HotkeyList m_Hotkeys; QString m_ServerName; bool m_IgnoreAutoConfigClient; + bool m_EnableDragAndDrop; MainWindow* m_pMainWindow; }; diff --git a/src/gui/src/ServerConfigDialog.cpp b/src/gui/src/ServerConfigDialog.cpp index 33159c3a..af423ed3 100644 --- a/src/gui/src/ServerConfigDialog.cpp +++ b/src/gui/src/ServerConfigDialog.cpp @@ -56,6 +56,8 @@ ServerConfigDialog::ServerConfigDialog(QWidget* parent, ServerConfig& config, co m_pCheckBoxIgnoreAutoConfigClient->setChecked(serverConfig().ignoreAutoConfigClient()); + m_pCheckBoxEnableDragAndDrop->setChecked(serverConfig().enableDragAndDrop()); + foreach(const Hotkey& hotkey, serverConfig().hotkeys()) m_pListHotkeys->addItem(hotkey.text()); @@ -97,6 +99,7 @@ void ServerConfigDialog::accept() serverConfig().setSwitchCorner(BaseConfig::BottomRight, m_pCheckBoxCornerBottomRight->isChecked()); serverConfig().setSwitchCornerSize(m_pSpinBoxSwitchCornerSize->value()); serverConfig().setIgnoreAutoConfigClient(m_pCheckBoxIgnoreAutoConfigClient->isChecked()); + serverConfig().setEnableDragAndDrop(m_pCheckBoxEnableDragAndDrop->isChecked()); // now that the dialog has been accepted, copy the new server config to the original one, // which is a reference to the one in MainWindow. From 72060e59b473b6c1a95042afa68d2f23b99315ef Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Fri, 12 Jun 2015 11:18:29 -0700 Subject: [PATCH 2/2] Fixed send clipboard thread time issue #4749 --- src/lib/client/Client.cpp | 1 + src/lib/server/Server.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index 52258d69..ad586809 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -273,6 +273,7 @@ Client::leave() if (m_sendClipboardThread != NULL) { StreamChunker::interruptClipboard(); + m_sendClipboardThread->wait(); m_sendClipboardThread = NULL; } diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index 4420b2dd..1f04489c 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -509,6 +509,8 @@ Server::switchScreen(BaseClientProxy* dst, // clipboard data could be corrupted on the other side if (m_sendClipboardThread != NULL) { StreamChunker::interruptClipboard(); + m_sendClipboardThread->wait(); + m_sendClipboardThread = NULL; } // send the clipboard data to new active screen