| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include <qpa/qwindowsysteminterface.h> |
| 5 | |
| 6 | #include "qminimaleglwindow.h" |
| 7 | |
| 8 | QT_BEGIN_NAMESPACE |
| 9 | |
| 10 | QMinimalEglWindow::QMinimalEglWindow(QWindow *w) |
| 11 | : QPlatformWindow(w) |
| 12 | { |
| 13 | static int serialNo = 0; |
| 14 | m_winid = ++serialNo; |
| 15 | #ifdef QEGL_EXTRA_DEBUG |
| 16 | qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_winid)); |
| 17 | #endif |
| 18 | |
| 19 | QRect screenGeometry(screen()->availableGeometry()); |
| 20 | if (w->geometry() != screenGeometry) { |
| 21 | QWindowSystemInterface::handleGeometryChange(window: w, newRect: screenGeometry); |
| 22 | } |
| 23 | w->setSurfaceType(QSurface::OpenGLSurface); |
| 24 | } |
| 25 | |
| 26 | void QMinimalEglWindow::setGeometry(const QRect &) |
| 27 | { |
| 28 | // We only support full-screen windows |
| 29 | QRect rect(screen()->availableGeometry()); |
| 30 | QWindowSystemInterface::handleGeometryChange(window: window(), newRect: rect); |
| 31 | |
| 32 | QPlatformWindow::setGeometry(rect); |
| 33 | } |
| 34 | |
| 35 | WId QMinimalEglWindow::winId() const |
| 36 | { |
| 37 | return m_winid; |
| 38 | } |
| 39 | |
| 40 | QT_END_NAMESPACE |
| 41 |
