From 6802f34bedca25e05d1eda962b268b1936dd4d62 Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Tue, 29 Oct 2013 10:10:32 +0100 Subject: Process screen events in the main thread Screen events are still read in the screen event thread but are processed in the main thread to make it possible to support QAbstractNativeEventFilter for screen events later. Implementation is similar to the xcb platform plugin. Change-Id: I7bade3e13e51c6d70bb608727a93bbd3aabc5d47 Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qqnxscreeneventthread.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/plugins/platforms/qnx/qqnxscreeneventthread.h') diff --git a/src/plugins/platforms/qnx/qqnxscreeneventthread.h b/src/plugins/platforms/qnx/qqnxscreeneventthread.h index 5e931819be..cbdb505b3b 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventthread.h +++ b/src/plugins/platforms/qnx/qqnxscreeneventthread.h @@ -43,6 +43,7 @@ #define QQNXSCREENEVENTTHREAD_H #include +#include #include @@ -50,21 +51,33 @@ QT_BEGIN_NAMESPACE class QQnxScreenEventHandler; +typedef QVarLengthArray QQnxScreenEventArray; + class QQnxScreenEventThread : public QThread { + Q_OBJECT + public: QQnxScreenEventThread(screen_context_t context, QQnxScreenEventHandler *screenEventHandler); ~QQnxScreenEventThread(); static void injectKeyboardEvent(int flags, int sym, int mod, int scan, int cap); + QQnxScreenEventArray *lock(); + void unlock(); + protected: void run(); +Q_SIGNALS: + void eventPending(); + private: void shutdown(); screen_context_t m_screenContext; + QMutex m_mutex; + QQnxScreenEventArray m_events; QQnxScreenEventHandler *m_screenEventHandler; bool m_quit; }; -- cgit v1.2.3