diff options
-rw-r--r-- | src/mumble/GlobalShortcut.cpp | 12 | ||||
-rw-r--r-- | src/mumble/GlobalShortcut.ui | 13 | ||||
-rw-r--r-- | src/mumble/GlobalShortcut_unix.cpp | 7 | ||||
-rw-r--r-- | src/mumble/Settings.cpp | 14 |
4 files changed, 46 insertions, 0 deletions
diff --git a/src/mumble/GlobalShortcut.cpp b/src/mumble/GlobalShortcut.cpp index ab540cf68..0dae14e39 100644 --- a/src/mumble/GlobalShortcut.cpp +++ b/src/mumble/GlobalShortcut.cpp @@ -9,6 +9,7 @@ #include "Channel.h" #include "ClientUser.h" #include "Database.h" +#include "EnvUtils.h" #include "MainWindow.h" #include "Global.h" #include "GlobalShortcutButtons.h" @@ -525,6 +526,16 @@ GlobalShortcutConfig::GlobalShortcutConfig(Settings &st) : ConfigWidget(st) { qcbEnableGlobalShortcuts->setVisible(canDisable); + qlWaylandNote->setVisible(false); +#ifdef Q_OS_LINUX + if (EnvUtils::waylandIsUsed()) { + // Our global shortcut system doesn't work with Wayland + qlWaylandNote->setVisible(true); + + qgbShortcuts->setEnabled(false); + } +#endif + #ifdef Q_OS_MAC // Help Mac users enable accessibility access for Mumble... # if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) @@ -750,6 +761,7 @@ QTreeWidgetItem *GlobalShortcutConfig::itemForShortcut(const Shortcut &sc) const void GlobalShortcutConfig::reload() { std::stable_sort(qlShortcuts.begin(), qlShortcuts.end()); qtwShortcuts->clear(); + foreach (const Shortcut &sc, qlShortcuts) { QTreeWidgetItem *item = itemForShortcut(sc); qtwShortcuts->addTopLevelItem(item); diff --git a/src/mumble/GlobalShortcut.ui b/src/mumble/GlobalShortcut.ui index e2796c53e..af65a45c1 100644 --- a/src/mumble/GlobalShortcut.ui +++ b/src/mumble/GlobalShortcut.ui @@ -96,6 +96,19 @@ </widget> </item> <item> + <widget class="QLabel" name="qlWaylandNote"> + <property name="text"> + <string><html><head/><body><p>Mumble's Global Shortcuts system does currently not work in combination with the Wayland protocol. For more information, visit <a href="https://github.com/mumble-voip/mumble/issues/5257"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/mumble-voip/mumble/issues/5257</span></a>.</p></body></html></string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + <item> <widget class="QGroupBox" name="qgbShortcuts"> <property name="title"> <string>Shortcuts</string> diff --git a/src/mumble/GlobalShortcut_unix.cpp b/src/mumble/GlobalShortcut_unix.cpp index 9c56bb616..0dab10101 100644 --- a/src/mumble/GlobalShortcut_unix.cpp +++ b/src/mumble/GlobalShortcut_unix.cpp @@ -5,6 +5,7 @@ #include "GlobalShortcut_unix.h" +#include "EnvUtils.h" #include "Settings.h" #include "Global.h" @@ -62,6 +63,12 @@ GlobalShortcutX::GlobalShortcutX() { } #ifdef Q_OS_LINUX + if (EnvUtils::waylandIsUsed()) { + qWarning("GlobalShortcutX: Global shortcuts don't work on Wayland (see " + "https://github.com/mumble-voip/mumble/issues/5257)"); + return; + } + if (Global::get().s.bEnableEvdev) { QString dir = QLatin1String("/dev/input"); QFileSystemWatcher *fsw = new QFileSystemWatcher(QStringList(dir), this); diff --git a/src/mumble/Settings.cpp b/src/mumble/Settings.cpp index 475e5eea4..86650c099 100644 --- a/src/mumble/Settings.cpp +++ b/src/mumble/Settings.cpp @@ -7,6 +7,7 @@ #include "AudioInput.h" #include "Cert.h" +#include "EnvUtils.h" #include "Log.h" #include "SSL.h" #include "Global.h" @@ -532,6 +533,12 @@ Settings::Settings() { bEnableXboxInput = true; bEnableUIAccess = true; +#ifdef Q_OS_LINUX + if (EnvUtils::waylandIsUsed()) { + bShortcutEnable = false; + } +#endif + for (int i = Log::firstMsgType; i <= Log::lastMsgType; ++i) { qmMessages.insert(i, Settings::LogConsole | Settings::LogBalloon | Settings::LogTTS | Settings::LogMessageLimit); @@ -1007,6 +1014,13 @@ void Settings::load(QSettings *settings_ptr) { LOAD(bEnableXboxInput, "shortcut/windows/xbox/enable"); LOAD(bEnableUIAccess, "shortcut/windows/uiaccess/enable"); +#ifdef Q_OS_LINUX + if (EnvUtils::waylandIsUsed()) { + // Global shortcuts don't work on Wayland + bShortcutEnable = false; + } +#endif + // Search options LOAD(searchForUsers, "search/search_for_users"); LOAD(searchForChannels, "search/search_for_channels"); |