Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-11-10 11:35:01 +0300
committerRobert Adam <dev@robert-adam.de>2021-11-10 12:06:14 +0300
commit1b03098345b817cffcdf87f432b5e5b3814c501e (patch)
treed335c48ade1c4973961b5fe46d92a17b070a27ea
parent5cb3e60f246ea4a6e15c1ae4ee2f8fe2292925af (diff)
FIX(client): Disable broken shortcuts on Wayland
Our global shortcut system currently doesn't work when using Wayland (https://github.com/mumble-voip/mumble/issues/5257). Therefore, this commit makes sure that the global shortcut system is not even started on such systems. Furthermore, it informs the user about the shortcuts being disabled. Fixes #5303
-rw-r--r--src/mumble/GlobalShortcut.cpp12
-rw-r--r--src/mumble/GlobalShortcut.ui13
-rw-r--r--src/mumble/GlobalShortcut_unix.cpp7
-rw-r--r--src/mumble/Settings.cpp14
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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Mumble's Global Shortcuts system does currently not work in combination with the Wayland protocol. For more information, visit &lt;a href=&quot;https://github.com/mumble-voip/mumble/issues/5257&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;https://github.com/mumble-voip/mumble/issues/5257&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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");