diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2013-09-13 13:02:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 12:05:08 +0200 |
commit | f89f099c55576992b39a8021aace64ff32747624 (patch) | |
tree | edefe8cefb81d63ef60440608112ee67ad837960 /src/plugins/platforms/eglfs/qeglfsintegration.cpp | |
parent | cfd52842492d12af26d897e0f893c80b2df5945a (diff) |
eglfs: Support multiple raster windows
Allow widget apps with popups and multiple top-level widgets to
function on the eglfs platform. GL and Quick2 apps are not affected.
Instead of trying to create a native window and EGL surface for each
window, do it only for the window that is created first. This first
window is forced to fullscreen as usual. Later windows however are
treated differently: These will not have a native window, surface or
context, and keep their normal size. All the textures belonging to the
raster windows are then rendered in one step, using a stacking order
maintained based on visibility changes and window activation.
Note that this will only help apps that create a main window first and
have everything else inside that window or on top of it as menus,
dialogs, popups, etc.
Change-Id: Ia435458ba81bf3c35cc8f61bcb2d2a50cf17f0e3
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/qeglfsintegration.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 487a2a15ec..12658e6d01 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -49,6 +49,7 @@ #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h> #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> +#include <QtPlatformSupport/private/qgenericunixservices_p.h> #include <QtPlatformSupport/private/qeglconvenience_p.h> #include <QtPlatformSupport/private/qeglplatformcontext_p.h> #include <QtPlatformSupport/private/qeglpbuffer_p.h> @@ -77,7 +78,9 @@ QT_BEGIN_NAMESPACE static void *eglContextForContext(QOpenGLContext *context); QEglFSIntegration::QEglFSIntegration() - : mEventDispatcher(createUnixEventDispatcher()), mFontDb(new QGenericUnixFontDatabase()) + : mEventDispatcher(createUnixEventDispatcher()), + mFontDb(new QGenericUnixFontDatabase), + mServices(new QGenericUnixServices) { QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher); @@ -161,7 +164,7 @@ QPlatformOffscreenSurface *QEglFSIntegration::createPlatformOffscreenSurface(QOf QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const { - return mFontDb; + return mFontDb.data(); } QAbstractEventDispatcher *QEglFSIntegration::guiThreadEventDispatcher() const @@ -171,10 +174,18 @@ QAbstractEventDispatcher *QEglFSIntegration::guiThreadEventDispatcher() const QVariant QEglFSIntegration::styleHint(QPlatformIntegration::StyleHint hint) const { - if (hint == QPlatformIntegration::ShowIsFullScreen) - return true; + switch (hint) + { + case QPlatformIntegration::ShowIsFullScreen: + return mScreen->rootWindow() == 0; + default: + return QPlatformIntegration::styleHint(hint); + } +} - return QPlatformIntegration::styleHint(hint); +QPlatformServices *QEglFSIntegration::services() const +{ + return mServices.data(); } QPlatformNativeInterface *QEglFSIntegration::nativeInterface() const @@ -187,7 +198,7 @@ void *QEglFSIntegration::nativeResourceForIntegration(const QByteArray &resource QByteArray lowerCaseResource = resource.toLower(); if (lowerCaseResource == "egldisplay") - return static_cast<QEglFSScreen *>(mScreen)->display(); + return mScreen->display(); return 0; } @@ -200,7 +211,7 @@ void *QEglFSIntegration::nativeResourceForWindow(const QByteArray &resource, QWi if (window && window->handle()) return static_cast<QEglFSScreen *>(window->handle()->screen())->display(); else - return static_cast<QEglFSScreen *>(mScreen)->display(); + return mScreen->display(); } return 0; |