Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandeglwindow.cpp
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
6
7#include <QtWaylandClient/private/qwaylandscreen_p.h>
8#include <QtWaylandClient/private/qwaylandsurface_p.h>
10
11#include <QtGui/private/qeglconvenience_p.h>
12
13#include <QDebug>
14#include <QtGui/QWindow>
15#include <qpa/qwindowsysteminterface.h>
16#include <QOpenGLFramebufferObject>
17#include <QOpenGLContext>
18
20
21namespace QtWaylandClient {
22
33
46
51
53{
54 // this is always called on the main thread
58 {
59 // keep a cache of the size that is safely accessible from the render thread
62 }
63}
64
70
72{
73 // potentially called from a render thread
74 // eglSurfaceLock should be locked before calling this method
75
77 return;
78
79 int current_width = 0;
80 int current_height = 0;
81 static bool disableResizeCheck = qgetenv("QT_WAYLAND_DISABLE_RESIZECHECK").toInt();
82
83 if (!disableResizeCheck) {
85 }
89 mOffset = QPoint();
90 m_resize = true;
91 }
92}
93
95{
96 // potentially called from a render thread
97 // eglSurfaceLock should be locked before calling this method
98
100 if (mSurface) {
102 if (Q_UNLIKELY(!eglWindow)) {
103 qCWarning(lcQpaWayland, "Could not create wl_egl_window with size %dx%d\n", initialSize.width(), initialSize.height());
104 return;
105 }
106
112
115 qCWarning(lcQpaWayland, "Could not create EGL surface (EGL error 0x%x)\n", eglGetError());
117 return;
118 }
119
123 }
124}
125
130
132{
133 QRect r = geometry();
135 return QRect(m.left(), m.bottom(), r.width(), r.height());
136}
137
153
159{
160 if (!decoration())
161 return 0;
162
163 if (m_resize || !m_contentFBO) {
165 QSize fboSize = geometry().size() * scale();
167
168 delete old;
169 m_resize = false;
170 }
171
172 return m_contentFBO->handle();
173}
174
179
181{
182 if (decoration()) {
183 contentFBO();
185 }
186}
187
188}
189
190QT_END_NAMESPACE
191
192#include "moc_qwaylandeglwindow_p.cpp"
Combined button and popup list for selecting options.