From ec2c0f4db6350a304dcf901b9adbadc895864c14 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 26 Jul 2017 14:54:23 +0200 Subject: Add QX11Info::peekEventQueue() API [ChangeLog][QX11Info] Added new API to peek into the XCB event queue - peekEventQueue(). This enables porting certain Qt4-based applications to Qt5 (those using Xlib's event handling functions to peek into the X11 event queue). In Qt5 we set XCB to be the owner of the X11 event queue with XSetEventQueueOwner(dpy, XCBOwnsEventQueue), which means that only XCB event handling functions can be used to read events from the X server. XCB does not have an equivalent for Xlib's peeker API. For filtering out unwanted native events Qt5 provides QAbstractNativeEventFilter::nativeEventFilter(), but there isn't any API in Qt to just *peek* into the queue while the GUI thread is busy processing a long task. The peekEventQueue() function adds this capability via QX11Info. Manual and auto test included. Task-number: QTBUG-50358 Change-Id: Id31f797f7ff76d011ad7a55a9b6c13756aaaca60 Reviewed-by: Edward Welbourne --- tests/manual/peeker/peeker.pro | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/manual/peeker/peeker.pro (limited to 'tests/manual/peeker/peeker.pro') diff --git a/tests/manual/peeker/peeker.pro b/tests/manual/peeker/peeker.pro new file mode 100644 index 0000000..aef58cd --- /dev/null +++ b/tests/manual/peeker/peeker.pro @@ -0,0 +1,6 @@ +QT += x11extras + +TARGET = peeker +TEMPLATE = app + +SOURCES += main.cpp -- cgit v1.2.1