From f89f099c55576992b39a8021aace64ff32747624 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 13 Sep 2013 13:02:20 +0200 Subject: 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 Reviewed-by: Andy Nichols --- src/plugins/platforms/eglfs/qeglfsscreen.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/eglfs/qeglfsscreen.cpp') diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index a726215e67..62f764b392 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE QEglFSScreen::QEglFSScreen(EGLDisplay dpy) : m_dpy(dpy) - , m_surface(0) + , m_surface(EGL_NO_SURFACE) , m_cursor(0) { #ifdef QEGL_EXTRA_DEBUG @@ -110,4 +110,24 @@ void QEglFSScreen::setPrimarySurface(EGLSurface surface) m_surface = surface; } +void QEglFSScreen::addWindow(QEglFSWindow *window) +{ + if (!m_windows.contains(window)) + m_windows.append(window); +} + +void QEglFSScreen::removeWindow(QEglFSWindow *window) +{ + m_windows.removeOne(window); +} + +QEglFSWindow *QEglFSScreen::rootWindow() +{ + Q_FOREACH (QEglFSWindow *window, m_windows) { + if (window->isRasterRoot()) + return window; + } + return 0; +} + QT_END_NAMESPACE -- cgit v1.2.3