More xlib plugin fixes

Change-Id: I8b8093cd9e66129dd7cc631dd36a2fb27c3d617e
Reviewed-on: http://codereview.qt-project.org/4408
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Paul Olav Tvete 2011-09-08 09:53:59 +02:00 committed by Samuel Rødal
parent 2b1b51b558
commit b05d022ccd
3 changed files with 27 additions and 28 deletions

View File

@ -105,7 +105,6 @@ bool QGLXContext::makeCurrent(QPlatformSurface *surface)
void QGLXContext::doneCurrent()
{
QPlatformOpenGLContext::doneCurrent();
glXMakeCurrent(m_screen->display()->nativeDisplay(), 0, 0);
}

View File

@ -63,29 +63,29 @@ public:
Q_GLOBAL_STATIC(QXlibResourceMap, qXlibResourceMap)
void * QXlibNativeInterface::nativeResourceForWidget(const QByteArray &resourceString, QWindow *widget)
void * QXlibNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
{
QByteArray lowerCaseResource = resourceString.toLower();
ResourceType resource = qXlibResourceMap()->value(lowerCaseResource);
void *result = 0;
switch(resource) {
case Display:
result = displayForWidget(widget);
result = displayForWindow(window);
break;
case EglDisplay:
result = eglDisplayForWidget(widget);
result = eglDisplayForWindow(window);
break;
case Connection:
result = connectionForWidget(widget);
result = connectionForWindow(window);
break;
case Screen:
result = reinterpret_cast<void *>(qPlatformScreenForWidget(widget)->xScreenNumber());
result = reinterpret_cast<void *>(qPlatformScreenForWindow(window)->xScreenNumber());
break;
case GraphicsDevice:
result = graphicsDeviceForWidget(widget);
result = graphicsDeviceForWindow(window);
break;
case EglContext:
result = eglContextForWidget(widget);
result = eglContextForWindow(window);
break;
default:
result = 0;
@ -93,37 +93,37 @@ void * QXlibNativeInterface::nativeResourceForWidget(const QByteArray &resourceS
return result;
}
void * QXlibNativeInterface::displayForWidget(QWindow *widget)
void * QXlibNativeInterface::displayForWindow(QWindow *window)
{
return qPlatformScreenForWidget(widget)->display()->nativeDisplay();
return qPlatformScreenForWindow(window)->display()->nativeDisplay();
}
void * QXlibNativeInterface::eglDisplayForWidget(QWindow *widget)
void * QXlibNativeInterface::eglDisplayForWindow(QWindow *window)
{
Q_UNUSED(widget);
Q_UNUSED(window);
return 0;
}
void * QXlibNativeInterface::screenForWidget(QWindow *widget)
void * QXlibNativeInterface::screenForWindow(QWindow *window)
{
Q_UNUSED(widget);
Q_UNUSED(window);
return 0;
}
void * QXlibNativeInterface::graphicsDeviceForWidget(QWindow *widget)
void * QXlibNativeInterface::graphicsDeviceForWindow(QWindow *window)
{
Q_UNUSED(widget);
Q_UNUSED(window);
return 0;
}
void * QXlibNativeInterface::eglContextForWidget(QWindow *widget)
void * QXlibNativeInterface::eglContextForWindow(QWindow *window)
{
Q_UNUSED(widget);
Q_UNUSED(window);
return 0;
}
QXlibScreen * QXlibNativeInterface::qPlatformScreenForWidget(QWindow *widget)
QXlibScreen * QXlibNativeInterface::qPlatformScreenForWindow(QWindow *window)
{
QScreen *screen = widget ? widget->screen() : QGuiApplication::primaryScreen();
QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen();
return static_cast<QXlibScreen *>(screen->handle());
}

View File

@ -58,17 +58,17 @@ public:
EglContext
};
void *nativeResourceForWidget(const QByteArray &resourceString, QWindow *widget);
void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window);
void *displayForWidget(QWindow *widget);
void *eglDisplayForWidget(QWindow *widget);
void *connectionForWidget(QWindow *widget);
void *screenForWidget(QWindow *widget);
void *graphicsDeviceForWidget(QWindow *widget);
void *eglContextForWidget(QWindow *widget);
void *displayForWindow(QWindow *window);
void *eglDisplayForWindow(QWindow *window);
void *connectionForWindow(QWindow *window);
void *screenForWindow(QWindow *window);
void *graphicsDeviceForWindow(QWindow *window);
void *eglContextForWindow(QWindow *window);
private:
static QXlibScreen *qPlatformScreenForWidget(QWindow *widget);
static QXlibScreen *qPlatformScreenForWindow(QWindow *window);
};