Prevent global shortcut crash on wayland.

The 3rd party qxt library assumes X11 on linux systems. Don't register
QxtGlobalShortcutBackend when using Wayland.
This commit is contained in:
Jim Broadus 2020-02-22 11:18:00 -08:00 committed by John Maguire
parent 60d3435324
commit 2179027a6d

View File

@ -23,12 +23,17 @@
#include "core/logging.h"
#include <QAction>
#include <QGuiApplication>
#include <QtDebug>
QxtGlobalShortcutBackend::QxtGlobalShortcutBackend(GlobalShortcuts* parent)
: GlobalShortcutBackend(parent) {}
bool QxtGlobalShortcutBackend::DoRegister() {
if (QGuiApplication::platformName() == "wayland") {
qLog(Warning) << "No support for Wayland in qxt.";
return false;
}
qLog(Debug) << "registering";
for (const GlobalShortcuts::Shortcut& shortcut :
manager_->shortcuts().values()) {