core/window: fix QsWindow being null for WlrLayershell

This commit is contained in:
outfoxxed 2025-07-04 17:58:55 -07:00
parent fb37be7611
commit 3cc7ced3a0
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 3 additions and 2 deletions

View file

@ -542,7 +542,8 @@ void ProxyWindowAttached::updateWindow() {
void ProxyWindowAttached::setWindow(ProxyWindowBase* window) {
if (window == this->mWindow) return;
this->mWindow = window;
this->mWindowInterface = window ? qobject_cast<WindowInterface*>(window->parent()) : nullptr;
auto* parentInterface = window ? qobject_cast<WindowInterface*>(window->parent()) : nullptr;
this->mWindowInterface = parentInterface ? static_cast<QObject*>(parentInterface) : window;
emit this->windowChanged();
}

View file

@ -220,7 +220,7 @@ protected:
private:
ProxyWindowBase* mWindow = nullptr;
WindowInterface* mWindowInterface = nullptr;
QObject* mWindowInterface = nullptr;
void setWindow(ProxyWindowBase* window);
};