summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfswindow.cpp
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@digia.com>2013-07-29 14:39:15 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-31 14:42:13 +0200
commitc837dbecdd9ab6707798cd26ae7979063eb8d93b (patch)
treebb92ec872ea6b094374c84f3125a94b113bfd180 /src/plugins/platforms/eglfs/qeglfswindow.cpp
parent22fbb5be6edd1b128d582f68c095ff5118dadc29 (diff)
eglfs: allow egl native window to be zero
Change the checking for created EGLNativeWindowType so that zero is a valid value. This is the case e.g, with BeagleBoard, where widget application cannot be run without this change. Change-Id: I36c30091e1a5a0598ae3822d0be8dc4362779c0b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfswindow.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 9aece1ea83..3b0c7de8e7 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -53,6 +53,7 @@ QEglFSWindow::QEglFSWindow(QWindow *w)
: QPlatformWindow(w)
, m_surface(0)
, m_window(0)
+ , has_window(false)
{
static int serialNo = 0;
m_winid = ++serialNo;
@@ -69,7 +70,7 @@ QEglFSWindow::~QEglFSWindow()
void QEglFSWindow::create()
{
- if (m_window)
+ if (has_window)
return;
setWindowState(Qt::WindowFullScreen);
@@ -91,7 +92,7 @@ void QEglFSWindow::create()
void QEglFSWindow::invalidateSurface()
{
// Native surface has been deleted behind our backs
- m_window = 0;
+ has_window = false;
if (m_surface != 0) {
EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display();
eglDestroySurface(display, m_surface);
@@ -104,6 +105,7 @@ void QEglFSWindow::resetSurface()
EGLDisplay display = static_cast<QEglFSScreen *>(screen())->display();
m_window = QEglFSHooks::hooks()->createNativeWindow(QEglFSHooks::hooks()->screenSize(), m_format);
+ has_window = true;
m_surface = eglCreateWindowSurface(display, m_config, m_window, NULL);
if (m_surface == EGL_NO_SURFACE) {
EGLint error = eglGetError();
@@ -120,9 +122,9 @@ void QEglFSWindow::destroy()
m_surface = 0;
}
- if (m_window) {
+ if (has_window) {
QEglFSHooks::hooks()->destroyNativeWindow(m_window);
- m_window = 0;
+ has_window = false;
}
}