Skip to content

Commit 1ea83fc

Browse files
committed
fix(wayland): resolve Qt 6.6.3 compatibility with QPointer of incomplete type
1 parent 5cb7422 commit 1ea83fc

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/wayland/session_lock/session_lock.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class LockWindowExtension: public QObject {
8888

8989
private:
9090
QSWaylandSessionLockSurface* surface = nullptr;
91-
QPointer<QSWaylandSessionLock> lock = nullptr;
91+
QPointer<QObject> lock = nullptr;
9292
bool immediatelyVisible = false;
9393

9494
friend class QSWaylandSessionLockSurface;

src/wayland/session_lock/surface.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <qobject.h>
99
#include <qtversionchecks.h>
1010
#include <qtypes.h>
11-
#include <wayland-client.h>
11+
#include <wayland-client.h> // NOLINT(misc-include-cleaner)
1212

1313
#include "lock.hpp"
1414
#include "session_lock.hpp"
@@ -22,7 +22,8 @@ QSWaylandSessionLockSurface::QSWaylandSessionLockSurface(QtWaylandClient::QWayla
2222
qFatal() << "QSWaylandSessionLockSurface created with null LockWindowExtension";
2323
}
2424

25-
if (this->ext->lock == nullptr) {
25+
auto* lock = qobject_cast<QSWaylandSessionLock*>(this->ext->lock.data());
26+
if (lock == nullptr) {
2627
qFatal() << "QSWaylandSessionLock for QSWaylandSessionLockSurface died";
2728
}
2829

@@ -35,15 +36,16 @@ QSWaylandSessionLockSurface::QSWaylandSessionLockSurface(QtWaylandClient::QWayla
3536
qFatal() << "Session lock screen does not correspond to a real screen. Force closing window";
3637
}
3738

38-
this->init(this->ext->lock->get_lock_surface(window->waylandSurface()->object(), output));
39+
this->init(lock->get_lock_surface(window->waylandSurface()->object(), output));
3940
}
4041

4142
QSWaylandSessionLockSurface::~QSWaylandSessionLockSurface() {
4243
bool shouldDestroyOnServer = true;
4344

4445
if (this->ext != nullptr) {
4546
this->ext->surface = nullptr;
46-
if (this->ext->lock == nullptr || !this->ext->lock->active()) {
47+
auto* lock = qobject_cast<QSWaylandSessionLock*>(this->ext->lock.data());
48+
if (lock == nullptr || !lock->active()) {
4749
shouldDestroyOnServer = false;
4850
} else {
4951
auto* qwindow = this->window() ? this->window()->window() : nullptr;
@@ -61,7 +63,7 @@ QSWaylandSessionLockSurface::~QSWaylandSessionLockSurface() {
6163
this->destroy();
6264
} else {
6365
if (auto* obj = this->object()) {
64-
wl_proxy_destroy(reinterpret_cast<wl_proxy*>(obj));
66+
wl_proxy_destroy(reinterpret_cast<wl_proxy*>(obj)); // NOLINT(misc-include-cleaner)
6567
}
6668
}
6769
}

0 commit comments

Comments
 (0)