diff options
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 7803b3afe9..0727af4b40 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -114,6 +114,13 @@ QXcbConnection::QXcbConnection(const char *displayName) if (m_connection) printf("Successfully connected to display %s\n", m_displayName.constData()); + QSocketNotifier *notifier = new QSocketNotifier(xcb_get_file_descriptor(xcb_connection()), QSocketNotifier::Read, this); + connect(notifier, SIGNAL(activated(int)), this, SLOT(processXcbEvents())); + + QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; + connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(processXcbEvents())); + connect(dispatcher, SIGNAL(awake()), this, SLOT(processXcbEvents())); + xcb_prefetch_extension_data (m_connection, &xcb_xfixes_id); m_setup = xcb_get_setup(xcb_connection()); @@ -159,15 +166,6 @@ QXcbConnection::~QXcbConnection() delete m_keyboard; } -void QXcbConnection::setEventDispatcher(QAbstractEventDispatcher *dispatcher) -{ - QSocketNotifier *notifier = new QSocketNotifier(xcb_get_file_descriptor(xcb_connection()), QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)), this, SLOT(processXcbEvents())); - - connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(processXcbEvents())); - connect(dispatcher, SIGNAL(awake()), this, SLOT(processXcbEvents())); -} - void QXcbConnection::addWindow(xcb_window_t id, QXcbWindow *window) { m_mapper.insert(id, window); |