wayland/toplevel: null check window passed to Toplevel::setRectangle

Fixes Toplevel::unsetRectangle, which passes a null.
This commit is contained in:
outfoxxed committed 2026-08-15 15:55:46 -07:00
1 parent d9cbc90a8c
commit 21fec77de7
3 files changed
+7 -3

No files matched your search

+1
View File
@@ -13,3 +13,4 @@
- Fixed `qs kill` not waiting for the process to exit. - Fixed `qs kill` not waiting for the process to exit.
- Fixed IPC calls from children of a crashed and relaunched process crashing. - Fixed IPC calls from children of a crashed and relaunched process crashing.
- Fixed JsonAdapter crashing when deserializing new objects into an array. - Fixed JsonAdapter crashing when deserializing new objects into an array.
- Fixed `Toplevel.unsetRectangle` crashing when calle.
+1 -1
View File
@@ -98,7 +98,7 @@ void Toplevel::setRectangle(QObject* window, QRect rect) {
} }
this->rectangle = rect; this->rectangle = rect;
this->handle->setRectangle(proxyWindow->backingWindow(), rect); this->handle->setRectangle(proxyWindow ? proxyWindow->backingWindow() : nullptr, rect);
} }
void Toplevel::unsetRectangle() { this->setRectangle(nullptr, QRect()); } void Toplevel::unsetRectangle() { this->setRectangle(nullptr, QRect()); }
+5 -2
View File
@@ -121,8 +121,11 @@ void ToplevelHandle::setRectangle(QWindow* window, QRect rect) {
} }
} }
QObject::disconnect(this->rectWindow, nullptr, this, nullptr); if (this->rectWindow) {
this->rectWindow = nullptr; QObject::disconnect(this->rectWindow, nullptr, this, nullptr);
this->rectWindow = nullptr;
}
return; return;
} }