From 912df70e6936c43e5f9230f58f51fdb31c391346 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 13 Jul 2019 19:01:49 +0000 Subject: hotkey: do not crash on wayland session git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8997 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/hotkey/hotkeymanager_x11.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/plugins/General/hotkey/hotkeymanager_x11.cpp b/src/plugins/General/hotkey/hotkeymanager_x11.cpp index 016f132ba..26aac352b 100644 --- a/src/plugins/General/hotkey/hotkeymanager_x11.cpp +++ b/src/plugins/General/hotkey/hotkeymanager_x11.cpp @@ -78,6 +78,12 @@ quint32 Hotkey::defaultKey(int act) HotkeyManager::HotkeyManager(QObject *parent) : QObject(parent) { + if(!QX11Info::isPlatformX11()) + { + qWarning("HotkeyManager: X11 not found. Plugin disabled"); + return; + } + QCoreApplication::instance()->installEventFilter(this); WId rootWindow = DefaultRootWindow(QX11Info::display()); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); //load settings -- cgit v1.2.3-13-gbd6f