summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfswindow.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-14 09:05:42 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-14 09:06:31 +0200
commit5c23199d4e8ff21661dfa5aacc13149178e78cab (patch)
tree322aee61581d7c85f1ccb65e47d1e79eba1ba6c9 /src/plugins/platforms/eglfs/qeglfswindow.cpp
parent252bad7c589e03d3e12df02354b00a84d8e3159a (diff)
parentc8d9b17367cfdcb034d11f8a168ca4ae3993e7c3 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
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