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
4142QSWaylandSessionLockSurface::~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