refactor: Remove undocumented hold modifiers to switch code

This commit is contained in:
sithlord48 2026-06-21 12:24:20 -04:00 committed by Nick Bolton
parent 55b6789728
commit a45e81fb15
4 changed files with 1 additions and 31 deletions

View file

@ -628,12 +628,6 @@ void Config::readSectionOptions(ConfigReadContext &s)
} catch (SocketAddressException &e) { } catch (SocketAddressException &e) {
throw ServerConfigReadException(s, std::string("invalid address argument ") + e.what()); throw ServerConfigReadException(s, std::string("invalid address argument ") + e.what());
} }
} else if (name == "switchNeedsShift") {
addOption("", kOptionScreenSwitchNeedsShift, s.parseBoolean(value));
} else if (name == "switchNeedsControl") {
addOption("", kOptionScreenSwitchNeedsControl, s.parseBoolean(value));
} else if (name == "switchNeedsAlt") {
addOption("", kOptionScreenSwitchNeedsAlt, s.parseBoolean(value));
} else { } else {
handled = false; handled = false;
} }

View file

@ -460,6 +460,7 @@ private:
QStringLiteral("clipboardSharingSize"), QStringLiteral("clipboardSharingSize"),
QStringLiteral("switchCornerSize"), QStringLiteral("switchCornerSize"),
QStringLiteral("switchCorners"), QStringLiteral("switchCorners"),
QStringLiteral("switchNeeds"),
QStringLiteral("protocol"), QStringLiteral("protocol"),
QStringLiteral("heartbeat"), QStringLiteral("heartbeat"),
QStringLiteral("switchDelay"), QStringLiteral("switchDelay"),

View file

@ -841,16 +841,6 @@ bool Server::isSwitchOkay(
stopSwitch(); stopSwitch();
} }
// check for optional needed modifiers
if (KeyModifierMask mods = this->m_primaryClient->getToggleMask();
!preventSwitch && ((this->m_switchNeedsShift && ((mods & KeyModifierShift) != KeyModifierShift)) ||
(this->m_switchNeedsControl && ((mods & KeyModifierControl) != KeyModifierControl)) ||
(this->m_switchNeedsAlt && ((mods & KeyModifierAlt) != KeyModifierAlt)))) {
LOG_VERBOSE("need modifiers to switch");
preventSwitch = true;
stopSwitch();
}
return !preventSwitch; return !preventSwitch;
} }
@ -1076,10 +1066,6 @@ void Server::processOptions()
return; return;
} }
m_switchNeedsShift = false; // it seems if i don't add these
m_switchNeedsControl = false; // lines, the 'reload config' option
m_switchNeedsAlt = false; // doesnt' work correct.
bool newRelativeMoves = m_relativeMoves; bool newRelativeMoves = m_relativeMoves;
for (auto [optionId, optionValue] : *options) { for (auto [optionId, optionValue] : *options) {
const OptionID id = optionId; const OptionID id = optionId;
@ -1096,12 +1082,6 @@ void Server::processOptions()
m_switchTwoTapDelay = 0.0; m_switchTwoTapDelay = 0.0;
} }
stopSwitchTwoTap(); stopSwitchTwoTap();
} else if (id == kOptionScreenSwitchNeedsControl) {
m_switchNeedsControl = (value != 0);
} else if (id == kOptionScreenSwitchNeedsShift) {
m_switchNeedsShift = (value != 0);
} else if (id == kOptionScreenSwitchNeedsAlt) {
m_switchNeedsAlt = (value != 0);
} else if (id == kOptionRelativeMouseMoves) { } else if (id == kOptionRelativeMouseMoves) {
newRelativeMoves = (value != 0); newRelativeMoves = (value != 0);
} else if (id == kOptionDefaultLockToScreenState) { } else if (id == kOptionDefaultLockToScreenState) {

View file

@ -454,11 +454,6 @@ private:
bool m_switchTwoTapEngaged = false; bool m_switchTwoTapEngaged = false;
bool m_switchTwoTapArmed = false; bool m_switchTwoTapArmed = false;
// modifiers needed before switching
bool m_switchNeedsShift = false;
bool m_switchNeedsControl = false;
bool m_switchNeedsAlt = false;
// relative mouse move option // relative mouse move option
bool m_relativeMoves = false; bool m_relativeMoves = false;