diff --git a/src/mumble/GlobalShortcut.cpp b/src/mumble/GlobalShortcut.cpp
index ab540cf68d8..0dae14e39ba 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 e2796c53ec7..af65a45c1a9 100644
--- a/src/mumble/GlobalShortcut.ui
+++ b/src/mumble/GlobalShortcut.ui
@@ -95,6 +95,19 @@
+ -
+
+
+ <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>
+
+
+ true
+
+
+ true
+
+
+
-
diff --git a/src/mumble/GlobalShortcut_unix.cpp b/src/mumble/GlobalShortcut_unix.cpp
index 9c56bb616e7..af63d32900e 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,11 @@ 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 475e5eea4b0..86650c099ae 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");