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
8QT_BEGIN_NAMESPACE
9
10QMinimalEglWindow::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
26void 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
35WId QMinimalEglWindow::winId() const
36{
37 return m_winid;
38}
39
40QT_END_NAMESPACE
41

source code of qtbase/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp