@@ -48,16 +48,6 @@ void QSWaylandSessionLockSurface::applyConfigure() {
48
48
this ->window ()->resizeFromApplyConfigure (this ->size );
49
49
}
50
50
51
- bool QSWaylandSessionLockSurface::handleExpose (const QRegion& region) {
52
- if (this ->initBuf != nullptr ) {
53
- // at this point qt's next commit to the surface will have a new buffer, and we can safely delete this one.
54
- delete this ->initBuf ;
55
- this ->initBuf = nullptr ;
56
- }
57
-
58
- return this ->QtWaylandClient ::QWaylandShellSurface::handleExpose (region);
59
- }
60
-
61
51
void QSWaylandSessionLockSurface::setExtension (LockWindowExtension* ext) {
62
52
if (ext == nullptr ) {
63
53
if (this ->window () != nullptr ) this ->window ()->window ()->close ();
@@ -71,11 +61,6 @@ void QSWaylandSessionLockSurface::setExtension(LockWindowExtension* ext) {
71
61
}
72
62
}
73
63
74
- void QSWaylandSessionLockSurface::setVisible () {
75
- if (this ->configured && !this ->visible ) this ->initVisible ();
76
- this ->visible = true ;
77
- }
78
-
79
64
void QSWaylandSessionLockSurface::ext_session_lock_surface_v1_configure (
80
65
quint32 serial,
81
66
quint32 width,
@@ -97,33 +82,42 @@ void QSWaylandSessionLockSurface::ext_session_lock_surface_v1_configure(
97
82
#else
98
83
this ->window ()->updateExposure ();
99
84
#endif
85
+
86
+ #if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
100
87
if (this ->visible ) this ->initVisible ();
88
+ #endif
101
89
} else {
102
90
// applyConfigureWhenPossible runs too late and causes a protocol error on reconfigure.
103
91
this ->window ()->resizeFromApplyConfigure (this ->size );
104
92
}
105
93
}
106
94
107
- #if QT_VERSION < QT_VERSION_CHECK(6, 9 , 0)
95
+ #if QT_VERSION >= QT_VERSION_CHECK(6, 10 , 0)
108
96
109
- # include < private/qwaylandshmbackingstore_p.h >
97
+ bool QSWaylandSessionLockSurface::commitSurfaceRole () const { return false ; }
110
98
111
- void QSWaylandSessionLockSurface::initVisible () {
112
- this ->visible = true ;
99
+ void QSWaylandSessionLockSurface::setVisible () { this ->window ()->window ()->setVisible (true ); }
113
100
114
- // qt always commits a null buffer in QWaylandWindow::initWindow.
115
- // We attach a dummy buffer to satisfy ext_session_lock_v1.
116
- this ->initBuf = new QtWaylandClient::QWaylandShmBuffer (
117
- this ->window ()->display (),
118
- this ->size ,
119
- QImage::Format_ARGB32
120
- );
101
+ #else
121
102
122
- this ->window ()->waylandSurface ()->attach (this ->initBuf ->buffer (), 0 , 0 );
123
- this ->window ()->window ()->setVisible (true );
103
+ bool QSWaylandSessionLockSurface::handleExpose (const QRegion& region) {
104
+ if (this ->initBuf != nullptr ) {
105
+ // at this point qt's next commit to the surface will have a new buffer, and we can safely delete this one.
106
+ delete this ->initBuf ;
107
+ this ->initBuf = nullptr ;
108
+ }
109
+
110
+ return this ->QtWaylandClient ::QWaylandShellSurface::handleExpose (region);
124
111
}
125
112
126
- #else
113
+ void QSWaylandSessionLockSurface::setVisible () {
114
+ if (this ->configured && !this ->visible ) this ->initVisible ();
115
+ this ->visible = true ;
116
+ }
117
+
118
+ #endif
119
+
120
+ #if QT_VERSION < QT_VERSION_CHECK(6, 10, 0)
127
121
128
122
#include < cmath>
129
123
@@ -190,4 +184,23 @@ void QSWaylandSessionLockSurface::initVisible() {
190
184
}
191
185
}
192
186
187
+ #elif QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
188
+
189
+ #include < private/qwaylandshmbackingstore_p.h>
190
+
191
+ void QSWaylandSessionLockSurface::initVisible () {
192
+ this ->visible = true ;
193
+
194
+ // qt always commits a null buffer in QWaylandWindow::initWindow.
195
+ // We attach a dummy buffer to satisfy ext_session_lock_v1.
196
+ this ->initBuf = new QtWaylandClient::QWaylandShmBuffer (
197
+ this ->window ()->display (),
198
+ this ->size ,
199
+ QImage::Format_ARGB32
200
+ );
201
+
202
+ this ->window ()->waylandSurface ()->attach (this ->initBuf ->buffer (), 0 , 0 );
203
+ this ->window ()->window ()->setVisible (true );
204
+ }
205
+
193
206
#endif
0 commit comments