summaryrefslogtreecommitdiffhomepage
path: root/qxt-mini/qxtglobalshortcut_p.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-02-25 14:05:37 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-02-25 14:19:59 +0100
commit35a00c84e56749aab323bfb664cbaeccc984c168 (patch)
tree1ec99cebc00d95f88ba65046fccd28bf946839a7 /qxt-mini/qxtglobalshortcut_p.h
parent595a9399a570e691a414aeeec69625bc82ac42db (diff)
qxt-mini: multiple Linux support fixes
- Register an event filter once and keep it there. The refcount goes out of whack. Will further investigate. - Use an iterator over all shortcuts registered for given key combination - Lessen logspam Keyboard shortcut support on Linux looks pretty good now. The issue that blocked keys from being further processed was running XGrabKey multiple times with various modifiers. XGrabKey will block unlisted modifiers from being passed to other apps. The solution was to register once with AnyModifier and care about modifiers only later.
Diffstat (limited to 'qxt-mini/qxtglobalshortcut_p.h')
-rw-r--r--qxt-mini/qxtglobalshortcut_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/qxt-mini/qxtglobalshortcut_p.h b/qxt-mini/qxtglobalshortcut_p.h
index 9eadbc7f..1835f956 100644
--- a/qxt-mini/qxtglobalshortcut_p.h
+++ b/qxt-mini/qxtglobalshortcut_p.h
@@ -53,13 +53,17 @@ public:
bool unsetShortcut();
static bool error;
- static int ref;
static bool eventFilter(void* message);
bool nativeEventFilter(const QByteArray & eventType, void * message, long * result) override;
static void activateShortcut(quint32 nativeKey, quint32 nativeMods);
private:
+ struct event_filter_installer;
+ friend struct event_filter_installer;
+ struct tag {};
+ explicit QxtGlobalShortcutPrivate(tag);
+
static quint32 nativeKeycode(Qt::Key keycode);
static quint32 nativeModifiers(Qt::KeyboardModifiers modifiers);
@@ -67,6 +71,8 @@ private:
static bool unregisterShortcut(quint32 nativeKey, quint32 nativeMods);
static QHash<QPair<quint32, quint32>, QxtGlobalShortcut*> shortcuts;
+
+ static void ensure_event_filter();
};
#endif // QXTGLOBALSHORTCUT_P_H