XSync(m_glxIntegration->xDisplay(), False);
if (!m_config)
- m_config = qglx_findConfig(m_glxIntegration->xDisplay(), m_glxIntegration->screen(), m_window->glFormat());
+ m_config = qglx_findConfig(m_glxIntegration->xDisplay(), m_glxIntegration->screen(), m_window->format());
m_glxPixmap = glXCreatePixmap(m_glxIntegration->xDisplay(), m_config, m_pixmap,0);
mEglIntegration->initialize();
#endif
- connect(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock()), this, SLOT(flushRequests()));
-
mFd = wl_display_get_fd(mDisplay, sourceUpdate, this);
+}
+
+void QWaylandDisplay::eventDispatcherCreated(QAbstractEventDispatcher *dispatcher)
+{
+ connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(flushRequests()));
mReadNotifier = new QSocketNotifier(mFd, QSocketNotifier::Read, this);
connect(mReadNotifier, SIGNAL(activated(int)), this, SLOT(readEvents()));
#include <wayland-client.h>
+class QAbstractEventDispatcher;
class QWaylandInputDevice;
class QSocketNotifier;
class QWaylandBuffer;
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
+ void eventDispatcherCreated(QAbstractEventDispatcher *dispatcher);
+
public slots:
void createNewScreen(struct wl_output *output, QRect geometry);
void readEvents();
QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) const
{
#ifdef QT_WAYLAND_GL_SUPPORT
- return mDisplay->eglIntegration()->createEglWindow(window);
-#else
- return new QWaylandShmWindow(window);
+ if (window->surfaceType() == QWindow::OpenGLSurface)
+ return mDisplay->eglIntegration()->createEglWindow(window);
#endif
+ return new QWaylandShmWindow(window);
}
QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const
QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const
{
- return createUnixEventDispatcher();
+ QAbstractEventDispatcher *dispatcher = createUnixEventDispatcher();
+ mDisplay->eventDispatcherCreated(dispatcher);
+ return dispatcher;
}
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
if (visible) {
wl_surface_map_toplevel(mSurface);
+ QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
} else {
wl_surface_destroy(mSurface);
mSurface = NULL;