summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-09-30 10:45:28 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-30 13:45:16 +0200
commit1256ed05b2f38e9e0364244616474e75655b19f9 (patch)
tree1288c9bd4c4f258ac610ac55c38fc16859fa52a0 /src/plugins/platforms/xcb/qxcbconnection.h
parent99b3e68f2070f1d0c0796356d681db528edee688 (diff)
xcb: Don't connect() to event-dispatcher until we are sure we have one
QCoreApplication sets up the event dispatcher in the constructor, through createEventDispatcher(), which is overridden in QGuiApplication to take the platform-integration into account. The problem is that the platform integration is created before the event dispatcher, so when we create the QXcbConnection we are not guaranteed to have an event dispatcher yet. This is not an issue when using xcb_poll_for_queued_event() in a thread, but for the fallback case we connect to the event-dispatcher's awake() and aboutToBlock() signals. To ensure that we do this only when we have an event dispatcher we post a queued method invocation, that will be processed as one of the first events once there is an event-dispatcher. Change-Id: I623011af447b585884b84c7559737f134aab83e8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index 7cabe67a68..0e52b2ec46 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -298,11 +298,14 @@ public:
QXcbEventArray *lock();
void unlock();
- bool startThread();
+ void start();
signals:
void eventPending();
+private slots:
+ void registerForEvents();
+
private:
void addEvent(xcb_generic_event_t *event);
@@ -574,6 +577,8 @@ private:
QByteArray m_startupId;
QXcbSystemTrayTracker *m_systemTrayTracker;
+
+ friend class QXcbEventReader;
};
#define DISPLAY_FROM_XCB(object) ((Display *)(object->connection()->xlib_display()))