Get wayland plugin working again.

bb10
Samuel Rødal 2011-06-22 16:26:02 +02:00
parent 9512c440b5
commit f3440ddf52
5 changed files with 16 additions and 7 deletions

View File

@ -104,7 +104,7 @@ void QWaylandReadbackGlxWindow::createSurface()
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);

View File

@ -152,9 +152,12 @@ QWaylandDisplay::QWaylandDisplay(void)
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()));

View File

@ -49,6 +49,7 @@
#include <wayland-client.h>
class QAbstractEventDispatcher;
class QWaylandInputDevice;
class QSocketNotifier;
class QWaylandBuffer;
@ -91,6 +92,8 @@ public:
QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
void eventDispatcherCreated(QAbstractEventDispatcher *dispatcher);
public slots:
void createNewScreen(struct wl_output *output, QRect geometry);
void readEvents();

View File

@ -101,10 +101,10 @@ QPixmapData *QWaylandIntegration::createPixmapData(QPixmapData::PixelType type)
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
@ -125,7 +125,9 @@ QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *
QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const
{
return createUnixEventDispatcher();
QAbstractEventDispatcher *dispatcher = createUnixEventDispatcher();
mDisplay->eventDispatcherCreated(dispatcher);
return dispatcher;
}
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const

View File

@ -104,6 +104,7 @@ void QWaylandWindow::setVisible(bool visible)
if (visible) {
wl_surface_map_toplevel(mSurface);
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
} else {
wl_surface_destroy(mSurface);
mSurface = NULL;