From ed373612b7cb1705ab3de0d2a500f9ba1781e2d8 Mon Sep 17 00:00:00 2001 From: Dennis Gentry Date: Wed, 6 Jul 2022 16:16:37 -0700 Subject: [PATCH] Fix Broken Tilde and Grave (Backtick/Backquote) --- .../1541-fix-broken-tilde-and-grave | 3 ++ src/gui/src/Screen.cpp | 10 ++--- src/gui/src/ServerConfig.cpp | 38 +++++++++---------- src/lib/platform/OSXKeyState.cpp | 2 - 4 files changed, 27 insertions(+), 26 deletions(-) create mode 100644 doc/newsfragments/1541-fix-broken-tilde-and-grave diff --git a/doc/newsfragments/1541-fix-broken-tilde-and-grave b/doc/newsfragments/1541-fix-broken-tilde-and-grave new file mode 100644 index 00000000..55d13196 --- /dev/null +++ b/doc/newsfragments/1541-fix-broken-tilde-and-grave @@ -0,0 +1,3 @@ +Fix the regression introduced in #1214 that caused tilde (~) and grave +(`) to stop being sendable from at least a MacOS Barrier Server (and +probably others). Fixes Issues #1541 and #1407 diff --git a/src/gui/src/Screen.cpp b/src/gui/src/Screen.cpp index 1e3b8884..a694bcea 100644 --- a/src/gui/src/Screen.cpp +++ b/src/gui/src/Screen.cpp @@ -91,19 +91,19 @@ void Screen::saveSettings(QSettings& settings) const QTextStream& Screen::writeScreensSection(QTextStream& outStream) const { - outStream << "\t" << name() << ":" << endl; + outStream << "\t" << name() << ":" << Qt::endl; for (int i = 0; i < modifiers().size(); i++) { auto mod = static_cast(i); if (modifier(mod) != mod) { outStream << "\t\t" << modifierName(mod) << " = " << modifierName(modifier(mod)) - << endl; + << Qt::endl; } } for (int i = 0; i < fixes().size(); i++) { auto fix = static_cast(i); - outStream << "\t\t" << fixName(fix) << " = " << (fixes()[i] ? "true" : "false") << endl; + outStream << "\t\t" << fixName(fix) << " = " << (fixes()[i] ? "true" : "false") << Qt::endl; } outStream << "\t\t" << "switchCorners = none "; @@ -112,9 +112,9 @@ QTextStream& Screen::writeScreensSection(QTextStream& outStream) const outStream << "+" << switchCornerName(static_cast(i)) << " "; } } - outStream << endl; + outStream << Qt::endl; - outStream << "\t\t" << "switchCornerSize = " << switchCornerSize() << endl; + outStream << "\t\t" << "switchCornerSize = " << switchCornerSize() << Qt::endl; return outStream; } diff --git a/src/gui/src/ServerConfig.cpp b/src/gui/src/ServerConfig.cpp index 3392572a..856db673 100644 --- a/src/gui/src/ServerConfig.cpp +++ b/src/gui/src/ServerConfig.cpp @@ -210,56 +210,56 @@ int ServerConfig::adjacentScreenIndex(int idx, int deltaColumn, int deltaRow) co QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config) { - outStream << "section: screens" << endl; + outStream << "section: screens" << Qt::endl; for (const Screen& s : config.screens()) { if (!s.isNull()) s.writeScreensSection(outStream); } - outStream << "end" << endl << endl; + outStream << "end" << Qt::endl << Qt::endl; - outStream << "section: aliases" << endl; + outStream << "section: aliases" << Qt::endl; for (const Screen& s : config.screens()) { if (!s.isNull()) s.writeAliasesSection(outStream); } - outStream << "end" << endl << endl; + outStream << "end" << Qt::endl << Qt::endl; - outStream << "section: links" << endl; + outStream << "section: links" << Qt::endl; for (int i = 0; i < config.screens().size(); i++) if (!config.screens()[i].isNull()) { - outStream << "\t" << config.screens()[i].name() << ":" << endl; + outStream << "\t" << config.screens()[i].name() << ":" << Qt::endl; for (unsigned int j = 0; j < sizeof(neighbourDirs) / sizeof(neighbourDirs[0]); j++) { int idx = config.adjacentScreenIndex(i, neighbourDirs[j].x, neighbourDirs[j].y); if (idx != -1 && !config.screens()[idx].isNull()) - outStream << "\t\t" << neighbourDirs[j].name << " = " << config.screens()[idx].name() << endl; + outStream << "\t\t" << neighbourDirs[j].name << " = " << config.screens()[idx].name() << Qt::endl; } } - outStream << "end" << endl << endl; + outStream << "end" << Qt::endl << Qt::endl; - outStream << "section: options" << endl; + outStream << "section: options" << Qt::endl; if (config.hasHeartbeat()) - outStream << "\t" << "heartbeat = " << config.heartbeat() << endl; + outStream << "\t" << "heartbeat = " << config.heartbeat() << Qt::endl; - outStream << "\t" << "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << endl; - outStream << "\t" << "screenSaverSync = " << (config.screenSaverSync() ? "true" : "false") << endl; - outStream << "\t" << "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << endl; - outStream << "\t" << "clipboardSharing = " << (config.clipboardSharing() ? "true" : "false") << endl; + outStream << "\t" << "relativeMouseMoves = " << (config.relativeMouseMoves() ? "true" : "false") << Qt::endl; + outStream << "\t" << "screenSaverSync = " << (config.screenSaverSync() ? "true" : "false") << Qt::endl; + outStream << "\t" << "win32KeepForeground = " << (config.win32KeepForeground() ? "true" : "false") << Qt::endl; + outStream << "\t" << "clipboardSharing = " << (config.clipboardSharing() ? "true" : "false") << Qt::endl; if (config.hasSwitchDelay()) - outStream << "\t" << "switchDelay = " << config.switchDelay() << endl; + outStream << "\t" << "switchDelay = " << config.switchDelay() << Qt::endl; if (config.hasSwitchDoubleTap()) - outStream << "\t" << "switchDoubleTap = " << config.switchDoubleTap() << endl; + outStream << "\t" << "switchDoubleTap = " << config.switchDoubleTap() << Qt::endl; outStream << "\t" << "switchCorners = none "; for (int i = 0; i < config.switchCorners().size(); i++) { @@ -268,15 +268,15 @@ QTextStream& operator<<(QTextStream& outStream, const ServerConfig& config) outStream << "+" << config.switchCornerName(corner) << " "; } } - outStream << endl; + outStream << Qt::endl; - outStream << "\t" << "switchCornerSize = " << config.switchCornerSize() << endl; + outStream << "\t" << "switchCornerSize = " << config.switchCornerSize() << Qt::endl; for (const Hotkey& hotkey : config.hotkeys()) { outStream << hotkey; } - outStream << "end" << endl << endl; + outStream << "end" << Qt::endl << Qt::endl; return outStream; } diff --git a/src/lib/platform/OSXKeyState.cpp b/src/lib/platform/OSXKeyState.cpp index aad20729..1f50697c 100644 --- a/src/lib/platform/OSXKeyState.cpp +++ b/src/lib/platform/OSXKeyState.cpp @@ -131,8 +131,6 @@ static const KeyEntry s_controlKeys[] = { { kKeyEisuToggle, kVK_JIS_Eisu }, { kKeyKana, kVK_JIS_Kana }, { kKeyMuhenkan, s_int5VK }, - { kKeyHenkan, s_int4VK }, - { kKeyZenkaku, kVK_ANSI_Grave } };