summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfswindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfswindow.cpp')
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 1cc252d285..bf6e375ac0 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -55,12 +55,12 @@ QEglFSWindow::QEglFSWindow(QWindow *w)
: QPlatformWindow(w)
, m_surface(0)
, m_window(0)
+ , has_window(false)
{
- static int serialNo = 0;
- m_winid = ++serialNo;
#ifdef QEGL_EXTRA_DEBUG
- qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_winid));
+ qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_window));
#endif
+ w->setSurfaceType(QSurface::OpenGLSurface);
}
QEglFSWindow::~QEglFSWindow()
@@ -75,7 +75,7 @@ static inline bool supportsMultipleWindows()
void QEglFSWindow::create()
{
- if (m_window)
+ if (has_window)
return;
setWindowState(Qt::WindowFullScreen);
@@ -100,7 +100,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);
@@ -113,6 +113,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) {
@@ -138,9 +139,9 @@ void QEglFSWindow::destroy()
m_surface = 0;
}
- if (m_window) {
+ if (has_window) {
QEglFSHooks::hooks()->destroyNativeWindow(m_window);
- m_window = 0;
+ has_window = false;
}
}
@@ -160,7 +161,7 @@ void QEglFSWindow::setWindowState(Qt::WindowState)
WId QEglFSWindow::winId() const
{
- return m_winid;
+ return WId(m_window);
}
EGLSurface QEglFSWindow::surface() const