#6346 Make server bypass lock to screen if it's disable from config option

# Conflicts:
#	src/lib/server/Server.cpp
#	src/lib/server/Server.h
This commit is contained in:
XinyuHou 2016-11-24 12:22:39 +00:00 committed by Nick Bolton
parent 535627c871
commit 84dfeec2ed
4 changed files with 16 additions and 1 deletions

View File

@ -765,10 +765,12 @@ Config::readSectionOptions(ConfigReadContext& s)
else if (name == "win32KeepForeground") { else if (name == "win32KeepForeground") {
addOption("", kOptionWin32KeepForeground, s.parseBoolean(value)); addOption("", kOptionWin32KeepForeground, s.parseBoolean(value));
} }
else if (name == "disableLockToScreen") {
addOption("", kOptionDisableLockToScreen, s.parseBoolean(value));
}
else if (name == "clipboardSharing") { else if (name == "clipboardSharing") {
addOption("", kOptionClipboardSharing, s.parseBoolean(value)); addOption("", kOptionClipboardSharing, s.parseBoolean(value));
} }
else { else {
handled = false; handled = false;
} }
@ -1380,6 +1382,9 @@ Config::getOptionName(OptionID id)
if (id == kOptionScreenPreserveFocus) { if (id == kOptionScreenPreserveFocus) {
return "preserveFocus"; return "preserveFocus";
} }
if (id == kOptionDisableLockToScreen) {
return "disableLockToScreen";
}
if (id == kOptionClipboardSharing) { if (id == kOptionClipboardSharing) {
return "clipboardSharing"; return "clipboardSharing";
} }

View File

@ -92,6 +92,7 @@ Server::Server(
m_sendFileThread(NULL), m_sendFileThread(NULL),
m_writeToDropDirThread(NULL), m_writeToDropDirThread(NULL),
m_ignoreFileTransfer(false), m_ignoreFileTransfer(false),
m_disableLockToScreen(false),
m_enableClipboard(true), m_enableClipboard(true),
m_sendDragInfoThread(NULL), m_sendDragInfoThread(NULL),
m_waitDragInfoThread(true), m_waitDragInfoThread(true),
@ -421,6 +422,10 @@ Server::isLockedToScreenServer() const
bool bool
Server::isLockedToScreen() const Server::isLockedToScreen() const
{ {
if (m_disableLockToScreen) {
return false;
}
// locked if we say we're locked // locked if we say we're locked
if (isLockedToScreenServer()) { if (isLockedToScreenServer()) {
LOG((CLOG_NOTE "Cursor is locked to screen, check Scroll Lock key")); LOG((CLOG_NOTE "Cursor is locked to screen, check Scroll Lock key"));
@ -1177,6 +1182,9 @@ Server::processOptions()
else if (id == kOptionRelativeMouseMoves) { else if (id == kOptionRelativeMouseMoves) {
newRelativeMoves = (value != 0); newRelativeMoves = (value != 0);
} }
else if (id == kOptionDisableLockToScreen) {
m_disableLockToScreen = true;
}
else if (id == kOptionClipboardSharing) { else if (id == kOptionClipboardSharing) {
m_enableClipboard = (value != 0); m_enableClipboard = (value != 0);

View File

@ -473,6 +473,7 @@ private:
Thread* m_writeToDropDirThread; Thread* m_writeToDropDirThread;
String m_dragFileExt; String m_dragFileExt;
bool m_ignoreFileTransfer; bool m_ignoreFileTransfer;
bool m_disableLockToScreen;
bool m_enableClipboard; bool m_enableClipboard;
Thread* m_sendDragInfoThread; Thread* m_sendDragInfoThread;

View File

@ -67,6 +67,7 @@ static const OptionID kOptionXTestXineramaUnaware = OPTION_CODE("XTXU"
static const OptionID kOptionScreenPreserveFocus = OPTION_CODE("SFOC"); static const OptionID kOptionScreenPreserveFocus = OPTION_CODE("SFOC");
static const OptionID kOptionRelativeMouseMoves = OPTION_CODE("MDLT"); static const OptionID kOptionRelativeMouseMoves = OPTION_CODE("MDLT");
static const OptionID kOptionWin32KeepForeground = OPTION_CODE("_KFW"); static const OptionID kOptionWin32KeepForeground = OPTION_CODE("_KFW");
static const OptionID kOptionDisableLockToScreen = OPTION_CODE("DLTS");
static const OptionID kOptionClipboardSharing = OPTION_CODE("CLPS"); static const OptionID kOptionClipboardSharing = OPTION_CODE("CLPS");
//@} //@}