refactor(Settings): move win32keepForeground to general settings
This commit is contained in:
parent
46e90e12ff
commit
69b9baaaeb
8 changed files with 20 additions and 27 deletions
|
|
@ -154,6 +154,7 @@ This section contains options used when in server mode it will begin with `[serv
|
||||||
|relativeMouseMoves | `true` or `false` | If set to ''true'' then secondary computers move the mouse using relative rather than absolute mouse moves when and only when the cursor is locked to the computer (by ''Scroll Lock'' or a configured hot key). This is intended to make Deskflow work better with certain games. If set to ''false'' or not set then all mouse moves are absolute.|
|
|relativeMouseMoves | `true` or `false` | If set to ''true'' then secondary computers move the mouse using relative rather than absolute mouse moves when and only when the cursor is locked to the computer (by ''Scroll Lock'' or a configured hot key). This is intended to make Deskflow work better with certain games. If set to ''false'' or not set then all mouse moves are absolute.|
|
||||||
| switchDelay | int | Deskflow won't switch computers when the mouse reaches edge of a computer unless it stays on the edge for `N` milliseconds. This helps prevent unintentional switching when working near an edge. (default: 250)|
|
| switchDelay | int | Deskflow won't switch computers when the mouse reaches edge of a computer unless it stays on the edge for `N` milliseconds. This helps prevent unintentional switching when working near an edge. (default: 250)|
|
||||||
| switchDoubleTap | int | Deskflow won't switch computers when the mouse reaches the edge of a computer unless it's moved away from the edge and then back to the edge within `N` milliseconds. With the option you have to quickly tap the edge twice to switch. This helps prevent unintentional switching when working near the edge.|
|
| switchDoubleTap | int | Deskflow won't switch computers when the mouse reaches the edge of a computer unless it's moved away from the edge and then back to the edge within `N` milliseconds. With the option you have to quickly tap the edge twice to switch. This helps prevent unintentional switching when working near the edge.|
|
||||||
|
|win32KeepForeground | `true` or `false` | If set to ''true'' (the default), Deskflow will grab the foreground focus on a Windows server (thereby putting all other windows in the background) upon switching to a client. If set to ''false'', it will leave the currently foreground window in the foreground. Deskflow grabs the focus to avoid issues with other apps interfering with Deskflow's ability to read the hardware inputs. |
|
||||||
| xdpRestoreToken | UUID | Restore token provided by XDG portals |
|
| xdpRestoreToken | UUID | Restore token provided by XDG portals |
|
||||||
|
|
||||||
- You can use both the ''switchDelay'' and ''switchDoubleTap'' options at the same time. Deskflow will switch when either requirement is satisfied.
|
- You can use both the ''switchDelay'' and ''switchDoubleTap'' options at the same time. Deskflow will switch when either requirement is satisfied.
|
||||||
|
|
@ -281,7 +282,6 @@ switchCornerArray\3\switchCorner=false
|
||||||
switchCornerArray\4\switchCorner=false
|
switchCornerArray\4\switchCorner=false
|
||||||
switchCornerArray\size=4
|
switchCornerArray\size=4
|
||||||
switchCornerSize=0
|
switchCornerSize=0
|
||||||
win32KeepForeground=false
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -405,7 +405,6 @@ end
|
||||||
|screenSaverSync| `true` or `false`| ''Note: Removed in v1.14.1'' If set to ''false'' then Deskflow won't synchronize screen savers. Client screen savers will start according to their individual configurations. The server screen saver won't start if there is input, even if that input is directed toward a client computer.|
|
|screenSaverSync| `true` or `false`| ''Note: Removed in v1.14.1'' If set to ''false'' then Deskflow won't synchronize screen savers. Client screen savers will start according to their individual configurations. The server screen saver won't start if there is input, even if that input is directed toward a client computer.|
|
||||||
|clipboardSharing| `true` or `false`|If set to ''true'' then clipboard sharing will be enabled and the ''clipboardSharingSize'' setting will be used. If set to false, then clipboard sharing will be disabled and the the ''clipboardSharingSize'' setting will be ignored.|
|
|clipboardSharing| `true` or `false`|If set to ''true'' then clipboard sharing will be enabled and the ''clipboardSharingSize'' setting will be used. If set to false, then clipboard sharing will be disabled and the the ''clipboardSharingSize'' setting will be ignored.|
|
||||||
|clipboardSharingSize| integer (N)| Deskflow will send a maximum of `N` kilobytes of clipboard data to another computer when the mouse transitions to that computer.|
|
|clipboardSharingSize| integer (N)| Deskflow will send a maximum of `N` kilobytes of clipboard data to another computer when the mouse transitions to that computer.|
|
||||||
|win32KeepForeground | `true` or `false`| If set to ''true'' (the default), Deskflow will grab the foreground focus on a Windows server (thereby putting all other windows in the background) upon switching to a client. If set to ''false'', it will leave the currently foreground window in the foreground. Deskflow grabs the focus to avoid issues with other apps interfering with Deskflow's ability to read the hardware inputs. |
|
|
||||||
|keystroke(key) | actions | Binds the ''key'' combination key to the given ''actions''. ''key'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') optionally followed by a character or a key name, all separated by + (plus signs). You must have either modifiers or a character/key name or both. See below for `valid key names` and `actions`. Keyboard hot keys are handled while the cursor any computer. Separate actions can be assigned to press and release.|
|
|keystroke(key) | actions | Binds the ''key'' combination key to the given ''actions''. ''key'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') optionally followed by a character or a key name, all separated by + (plus signs). You must have either modifiers or a character/key name or both. See below for `valid key names` and `actions`. Keyboard hot keys are handled while the cursor any computer. Separate actions can be assigned to press and release.|
|
||||||
|mousebutton(button) | actions| Binds the modifier and mouse button combination ''button'' to the given ''actions''. ''button'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') followed by a button number. The primary button (the left button for right handed users) is button 1, the middle button is 2, etc. Actions can be found below. Mouse button actions are not handled while the cursor is on the server. You cannot use these to perform an action while on the server. Separate actions can be assigned to press and release.|
|
|mousebutton(button) | actions| Binds the modifier and mouse button combination ''button'' to the given ''actions''. ''button'' is an optional list of modifiers (''shift'', ''control'', ''alt'', ''meta'' or ''super'') followed by a button number. The primary button (the left button for right handed users) is button 1, the middle button is 2, etc. Actions can be found below. Mouse button actions are not handled while the cursor is on the server. You cannot use these to perform an action while on the server. Separate actions can be assigned to press and release.|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ public:
|
||||||
inline static const auto RelativeMouseMoves = QStringLiteral("server/relativeMouseMoves");
|
inline static const auto RelativeMouseMoves = QStringLiteral("server/relativeMouseMoves");
|
||||||
inline static const auto SwitchDelay = QStringLiteral("server/switchDelay");
|
inline static const auto SwitchDelay = QStringLiteral("server/switchDelay");
|
||||||
inline static const auto SwitchDoubleTap = QStringLiteral("server/switchDoubleTap");
|
inline static const auto SwitchDoubleTap = QStringLiteral("server/switchDoubleTap");
|
||||||
|
inline static const auto Win32KeepForeground = QStringLiteral("server/win32KeepForeground");
|
||||||
inline static const auto XdpRestoreToken = QStringLiteral("server/xdpRestoreToken");
|
inline static const auto XdpRestoreToken = QStringLiteral("server/xdpRestoreToken");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -262,6 +263,7 @@ private:
|
||||||
, Settings::Server::RelativeMouseMoves
|
, Settings::Server::RelativeMouseMoves
|
||||||
, Settings::Server::SwitchDelay
|
, Settings::Server::SwitchDelay
|
||||||
, Settings::Server::SwitchDoubleTap
|
, Settings::Server::SwitchDoubleTap
|
||||||
|
, Settings::Server::Win32KeepForeground
|
||||||
, Settings::Server::XdpRestoreToken
|
, Settings::Server::XdpRestoreToken
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -299,6 +301,7 @@ private:
|
||||||
, Settings::Gui::SymbolicTrayIcon
|
, Settings::Gui::SymbolicTrayIcon
|
||||||
, Settings::Security::TlsEnabled
|
, Settings::Security::TlsEnabled
|
||||||
, Settings::Security::CheckPeers
|
, Settings::Security::CheckPeers
|
||||||
|
, Settings::Server::Win32KeepForeground
|
||||||
};
|
};
|
||||||
|
|
||||||
// Settings saved in our State file
|
// Settings saved in our State file
|
||||||
|
|
@ -321,6 +324,7 @@ private:
|
||||||
, QStringLiteral("interlanConfig/relativeMouseMoves")
|
, QStringLiteral("interlanConfig/relativeMouseMoves")
|
||||||
, QStringLiteral("internalConfig/switchDelay")
|
, QStringLiteral("internalConfig/switchDelay")
|
||||||
, QStringLiteral("internalConfig/switchDoubleTap")
|
, QStringLiteral("internalConfig/switchDoubleTap")
|
||||||
|
, QStringLiteral("internalConfig/win32KeepForeground")
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ bool ServerConfig::save(const QString &fileName) const
|
||||||
bool ServerConfig::operator==(const ServerConfig &sc) const
|
bool ServerConfig::operator==(const ServerConfig &sc) const
|
||||||
{
|
{
|
||||||
return m_Screens == sc.m_Screens && //
|
return m_Screens == sc.m_Screens && //
|
||||||
m_Win32KeepForeground == sc.m_Win32KeepForeground && //
|
|
||||||
m_SwitchCornerSize == sc.m_SwitchCornerSize && //
|
m_SwitchCornerSize == sc.m_SwitchCornerSize && //
|
||||||
m_SwitchCorners == sc.m_SwitchCorners && //
|
m_SwitchCorners == sc.m_SwitchCorners && //
|
||||||
m_Hotkeys == sc.m_Hotkeys && //
|
m_Hotkeys == sc.m_Hotkeys && //
|
||||||
|
|
@ -92,7 +91,6 @@ void ServerConfig::commit()
|
||||||
settings().beginGroup("internalConfig");
|
settings().beginGroup("internalConfig");
|
||||||
settings().remove("");
|
settings().remove("");
|
||||||
|
|
||||||
settings().setValue("win32KeepForeground", win32KeepForeground());
|
|
||||||
settings().setValue("switchCornerSize", switchCornerSize());
|
settings().setValue("switchCornerSize", switchCornerSize());
|
||||||
settings().setValue("defaultLockToScreenState", defaultLockToScreenState());
|
settings().setValue("defaultLockToScreenState", defaultLockToScreenState());
|
||||||
settings().setValue("disableLockToScreen", disableLockToScreen());
|
settings().setValue("disableLockToScreen", disableLockToScreen());
|
||||||
|
|
@ -136,7 +134,6 @@ void ServerConfig::recall()
|
||||||
// ourselves
|
// ourselves
|
||||||
setupScreens();
|
setupScreens();
|
||||||
|
|
||||||
setWin32KeepForeground(settings().value("win32KeepForeground", false).toBool());
|
|
||||||
setSwitchCornerSize(settings().value("switchCornerSize").toInt());
|
setSwitchCornerSize(settings().value("switchCornerSize").toInt());
|
||||||
setDefaultLockToScreenState(settings().value("defaultLockToScreenState", false).toBool());
|
setDefaultLockToScreenState(settings().value("defaultLockToScreenState", false).toBool());
|
||||||
setDisableLockToScreen(settings().value("disableLockToScreen", false).toBool());
|
setDisableLockToScreen(settings().value("disableLockToScreen", false).toBool());
|
||||||
|
|
@ -225,9 +222,6 @@ QTextStream &operator<<(QTextStream &outStream, const ServerConfig &config)
|
||||||
outStream << "end" << Qt::endl << Qt::endl;
|
outStream << "end" << Qt::endl << Qt::endl;
|
||||||
|
|
||||||
outStream << "section: options" << Qt::endl;
|
outStream << "section: options" << Qt::endl;
|
||||||
|
|
||||||
outStream << "\t"
|
|
||||||
<< "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << Qt::endl;
|
|
||||||
outStream << "\t"
|
outStream << "\t"
|
||||||
<< "defaultLockToScreenState = " << (config.defaultLockToScreenState() ? "true" : "false") << Qt::endl;
|
<< "defaultLockToScreenState = " << (config.defaultLockToScreenState() ? "true" : "false") << Qt::endl;
|
||||||
outStream << "\t"
|
outStream << "\t"
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,6 @@ public:
|
||||||
//
|
//
|
||||||
// New methods
|
// New methods
|
||||||
//
|
//
|
||||||
bool win32KeepForeground() const
|
|
||||||
{
|
|
||||||
return m_Win32KeepForeground;
|
|
||||||
}
|
|
||||||
bool switchCorner(int c) const
|
bool switchCorner(int c) const
|
||||||
{
|
{
|
||||||
return m_SwitchCorners[c];
|
return m_SwitchCorners[c];
|
||||||
|
|
@ -106,10 +102,6 @@ private:
|
||||||
{
|
{
|
||||||
m_Screens.append(screen);
|
m_Screens.append(screen);
|
||||||
}
|
}
|
||||||
void setWin32KeepForeground(bool on)
|
|
||||||
{
|
|
||||||
m_Win32KeepForeground = on;
|
|
||||||
}
|
|
||||||
void setSwitchCorner(int c, bool on)
|
void setSwitchCorner(int c, bool on)
|
||||||
{
|
{
|
||||||
m_SwitchCorners[c] = on;
|
m_SwitchCorners[c] = on;
|
||||||
|
|
@ -146,7 +138,6 @@ private:
|
||||||
bool fixNoServer(const QString &name, int &index);
|
bool fixNoServer(const QString &name, int &index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_Win32KeepForeground = false;
|
|
||||||
int m_SwitchCornerSize = 0;
|
int m_SwitchCornerSize = 0;
|
||||||
bool m_DefaultLockToScreenState = false;
|
bool m_DefaultLockToScreenState = false;
|
||||||
bool m_DisableLockToScreen = false;
|
bool m_DisableLockToScreen = false;
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ void ServerConfigDialog::accept()
|
||||||
Settings::setValue(Settings::Server::EnableSwitchDoubleTap, m_enableSwitchDoubleTap);
|
Settings::setValue(Settings::Server::EnableSwitchDoubleTap, m_enableSwitchDoubleTap);
|
||||||
Settings::setValue(Settings::Server::SwitchDoubleTap, m_switchDoubleTap);
|
Settings::setValue(Settings::Server::SwitchDoubleTap, m_switchDoubleTap);
|
||||||
Settings::setValue(Settings::Server::RelativeMouseMoves, m_relativeMouseMoves);
|
Settings::setValue(Settings::Server::RelativeMouseMoves, m_relativeMouseMoves);
|
||||||
|
Settings::setValue(Settings::Server::Win32KeepForeground, m_win32keepForeground);
|
||||||
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
@ -339,7 +340,9 @@ void ServerConfigDialog::toggleLockToScreen(bool disabled)
|
||||||
|
|
||||||
void ServerConfigDialog::toggleWin32Foreground(bool enabled)
|
void ServerConfigDialog::toggleWin32Foreground(bool enabled)
|
||||||
{
|
{
|
||||||
serverConfig().setWin32KeepForeground(enabled);
|
if (m_win32keepForeground == enabled)
|
||||||
|
return;
|
||||||
|
m_win32keepForeground = enabled;
|
||||||
onChange();
|
onChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -361,7 +364,6 @@ void ServerConfigDialog::toggleExternalConfig(bool checked)
|
||||||
ui->tabWidget->setTabEnabled(1, !checked);
|
ui->tabWidget->setTabEnabled(1, !checked);
|
||||||
ui->cbDefaultLockToScreenState->setEnabled(!checked);
|
ui->cbDefaultLockToScreenState->setEnabled(!checked);
|
||||||
ui->cbDisableLockToScreen->setEnabled(!checked);
|
ui->cbDisableLockToScreen->setEnabled(!checked);
|
||||||
ui->cbWin32KeepForeground->setEnabled(!checked);
|
|
||||||
ui->cbEnableClipboard->setEnabled(!checked);
|
ui->cbEnableClipboard->setEnabled(!checked);
|
||||||
ui->label_7->setEnabled(checked ? !checked : ui->cbEnableClipboard->isChecked());
|
ui->label_7->setEnabled(checked ? !checked : ui->cbEnableClipboard->isChecked());
|
||||||
ui->sbClipboardSizeLimit->setEnabled(checked ? !checked : ui->cbEnableClipboard->isChecked());
|
ui->sbClipboardSizeLimit->setEnabled(checked ? !checked : ui->cbEnableClipboard->isChecked());
|
||||||
|
|
@ -407,7 +409,8 @@ void ServerConfigDialog::loadFromConfig()
|
||||||
m_relativeMouseMoves = Settings::value(Settings::Server::RelativeMouseMoves).toBool();
|
m_relativeMouseMoves = Settings::value(Settings::Server::RelativeMouseMoves).toBool();
|
||||||
ui->cbRelativeMouseMoves->setChecked(m_relativeMouseMoves);
|
ui->cbRelativeMouseMoves->setChecked(m_relativeMouseMoves);
|
||||||
|
|
||||||
ui->cbWin32KeepForeground->setChecked(serverConfig().win32KeepForeground());
|
m_win32keepForeground = Settings::value(Settings::Server::Win32KeepForeground).toBool();
|
||||||
|
ui->cbWin32KeepForeground->setChecked(m_win32keepForeground);
|
||||||
|
|
||||||
m_enableSwitchDelay = Settings::value(Settings::Server::EnableSwitchDelay).toBool();
|
m_enableSwitchDelay = Settings::value(Settings::Server::EnableSwitchDelay).toBool();
|
||||||
ui->cbSwitchDelay->setChecked(m_enableSwitchDelay);
|
ui->cbSwitchDelay->setChecked(m_enableSwitchDelay);
|
||||||
|
|
@ -545,7 +548,8 @@ void ServerConfigDialog::onChange()
|
||||||
m_switchDelay == Settings::value(Settings::Server::SwitchDelay).toInt() &&
|
m_switchDelay == Settings::value(Settings::Server::SwitchDelay).toInt() &&
|
||||||
m_enableSwitchDoubleTap == Settings::value(Settings::Server::EnableSwitchDoubleTap).toBool() &&
|
m_enableSwitchDoubleTap == Settings::value(Settings::Server::EnableSwitchDoubleTap).toBool() &&
|
||||||
m_switchDoubleTap == Settings::value(Settings::Server::SwitchDoubleTap).toInt() &&
|
m_switchDoubleTap == Settings::value(Settings::Server::SwitchDoubleTap).toInt() &&
|
||||||
m_relativeMouseMoves == Settings::value(Settings::Server::RelativeMouseMoves).toBool();
|
m_relativeMouseMoves == Settings::value(Settings::Server::RelativeMouseMoves).toBool() &&
|
||||||
|
m_win32keepForeground == Settings::value(Settings::Server::Win32KeepForeground).toBool();
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)
|
ui->buttonBox->button(QDialogButtonBox::Ok)
|
||||||
->setEnabled(!isAppConfigDataEqual || !(m_originalServerConfig == m_serverConfig));
|
->setEnabled(!isAppConfigDataEqual || !(m_originalServerConfig == m_serverConfig));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ private:
|
||||||
bool m_enableSwitchDelay;
|
bool m_enableSwitchDelay;
|
||||||
bool m_enableSwitchDoubleTap;
|
bool m_enableSwitchDoubleTap;
|
||||||
bool m_originalServerConfigIsExternal;
|
bool m_originalServerConfigIsExternal;
|
||||||
|
bool m_win32keepForeground;
|
||||||
QString m_originalServerConfigUsesExternalFile;
|
QString m_originalServerConfigUsesExternalFile;
|
||||||
ServerConfig m_serverConfig;
|
ServerConfig m_serverConfig;
|
||||||
ScreenSetupModel m_screenSetupModel;
|
ScreenSetupModel m_screenSetupModel;
|
||||||
|
|
|
||||||
|
|
@ -636,11 +636,8 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
||||||
|
|
||||||
bool handled = true;
|
bool handled = true;
|
||||||
|
|
||||||
// Skip old option names
|
if (m_oldNames.contains(name))
|
||||||
if (name == "protocol" || name == "heartbeat" || name == "switchDelay" || name == "switchDoubleTap" ||
|
|
||||||
name == "relativeMouseMoves") {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (name == "address") {
|
if (name == "address") {
|
||||||
try {
|
try {
|
||||||
|
|
@ -659,8 +656,6 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
||||||
addOption("", kOptionScreenSwitchNeedsControl, s.parseBoolean(value));
|
addOption("", kOptionScreenSwitchNeedsControl, s.parseBoolean(value));
|
||||||
} else if (name == "switchNeedsAlt") {
|
} else if (name == "switchNeedsAlt") {
|
||||||
addOption("", kOptionScreenSwitchNeedsAlt, s.parseBoolean(value));
|
addOption("", kOptionScreenSwitchNeedsAlt, s.parseBoolean(value));
|
||||||
} else if (name == "win32KeepForeground") {
|
|
||||||
addOption("", kOptionWin32KeepForeground, s.parseBoolean(value));
|
|
||||||
} else if (name == "defaultLockToScreenState") {
|
} else if (name == "defaultLockToScreenState") {
|
||||||
addOption("", kOptionDefaultLockToScreenState, s.parseBoolean(value));
|
addOption("", kOptionDefaultLockToScreenState, s.parseBoolean(value));
|
||||||
} else if (name == "disableLockToScreen") {
|
} else if (name == "disableLockToScreen") {
|
||||||
|
|
@ -730,6 +725,7 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
||||||
}
|
}
|
||||||
|
|
||||||
addOption("", kOptionRelativeMouseMoves, Settings::value(Settings::Server::RelativeMouseMoves).toInt());
|
addOption("", kOptionRelativeMouseMoves, Settings::value(Settings::Server::RelativeMouseMoves).toInt());
|
||||||
|
addOption("", kOptionWin32KeepForeground, Settings::value(Settings::Server::Win32KeepForeground).toInt());
|
||||||
|
|
||||||
throw ServerConfigReadException(s, "unexpected end of options section");
|
throw ServerConfigReadException(s, "unexpected end of options section");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -475,6 +475,10 @@ private:
|
||||||
InputFilter m_inputFilter;
|
InputFilter m_inputFilter;
|
||||||
bool m_hasLockToScreenAction = false;
|
bool m_hasLockToScreenAction = false;
|
||||||
IEventQueue *m_events;
|
IEventQueue *m_events;
|
||||||
|
inline static const QStringList m_oldNames = {
|
||||||
|
QStringLiteral("protocol"), QStringLiteral("heartbeat"), QStringLiteral("switchDelay"),
|
||||||
|
QStringLiteral("switchDoubleTap"), QStringLiteral("relativeMouseMoves"), QStringLiteral("win32KeepForeground")
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Configuration read context
|
//! Configuration read context
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue