aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/hotkey/hotkeymanager_x11.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-11-25 18:00:06 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-11-25 18:00:06 +0000
commit8453224119a4c5ff7d47d9cd4924d0b1ccb99b3a (patch)
tree15d339b62e98d5858a57aa787334e14f0e2f0ad7 /src/plugins/General/hotkey/hotkeymanager_x11.cpp
parent6fc05db7c6de9a51beba754f12ff4ac32859977d (diff)
downloadqmmp-8453224119a4c5ff7d47d9cd4924d0b1ccb99b3a.tar.gz
qmmp-8453224119a4c5ff7d47d9cd4924d0b1ccb99b3a.tar.bz2
qmmp-8453224119a4c5ff7d47d9cd4924d0b1ccb99b3a.zip
copy 1.2 branch to trunk
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7772 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/hotkey/hotkeymanager_x11.cpp')
-rw-r--r--src/plugins/General/hotkey/hotkeymanager_x11.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/General/hotkey/hotkeymanager_x11.cpp b/src/plugins/General/hotkey/hotkeymanager_x11.cpp
index 3954eebb3..05b46280a 100644
--- a/src/plugins/General/hotkey/hotkeymanager_x11.cpp
+++ b/src/plugins/General/hotkey/hotkeymanager_x11.cpp
@@ -21,7 +21,7 @@
***************************************************************************/
#include <QtGlobal>
-#ifdef Q_WS_X11
+#ifdef QMMP_WS_X11
#include <QSettings>
#include <QX11Info>
#include <QEvent>
@@ -80,6 +80,12 @@ quint32 Hotkey::defaultKey(int act)
HotkeyManager::HotkeyManager(QObject *parent) : QObject(parent)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
+ //Workaround Qt regression of no longer delivering events for the root window
+ //See qtbase commit 2b34aefcf02f09253473b096eb4faffd3e62b5f4
+ //More information: https://bugs.kde.org/show_bug.cgi?id=360841
+ qApp->desktop()->winId();
+#endif
QCoreApplication::instance()->installEventFilter(this);
WId rootWindow = QX11Info::appRootWindow();
QSettings settings(Qmmp::configFile(), QSettings::IniFormat); //load settings
@@ -138,8 +144,7 @@ const QString HotkeyManager::getKeyString(quint32 key, quint32 modifiers)
bool HotkeyManager::eventFilter(QObject* o, QEvent* e)
{
- //receive events from active and root windows only
- if (e->type() == QEvent::KeyPress && (o == qApp->desktop () || o == qApp->activeWindow ()))
+ if (e->type() == QEvent::KeyPress)
{
QKeyEvent* k = static_cast<QKeyEvent*>(e);
quint32 key = keycodeToKeysym(k->nativeScanCode());
@@ -198,7 +203,7 @@ bool HotkeyManager::eventFilter(QObject* o, QEvent* e)
break;
}
- qApp->processEvents();
+ return true;
}
}
return QObject::eventFilter(o, e);