#ifdef XCB_USE_DRI2
initializeDri2();
#endif
-
- QSocketNotifier *notifier = new QSocketNotifier(xcb_get_file_descriptor(xcb_connection()), QSocketNotifier::Read, this);
- connect(notifier, SIGNAL(activated(int)), this, SLOT(processXcbEvents()));
-
- QAbstractEventDispatcher *dispatcher = QAbstractEventDispatcher::instance(qApp->thread());
- connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(processXcbEvents()));
- connect(dispatcher, SIGNAL(awake()), this, SLOT(processXcbEvents()));
-
sync();
}
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);
};
}
+class QAbstractEventDispatcher;
class QXcbConnection : public QObject
{
Q_OBJECT
QXcbConnection *connection() const { return const_cast<QXcbConnection *>(this); }
+ void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher);
+
const QList<QXcbScreen *> &screens() const { return m_screens; }
int primaryScreen() const { return m_primaryScreen; }
QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const
{
- return createUnixEventDispatcher();
+ QAbstractEventDispatcher *eventDispatcher = createUnixEventDispatcher();
+ m_connection->setEventDispatcher(eventDispatcher);
+ return eventDispatcher;
}
QList<QPlatformScreen *> QXcbIntegration::screens() const