Skip to content

Commit 3cc7ced

Browse files
committed
core/window: fix QsWindow being null for WlrLayershell
1 parent fb37be7 commit 3cc7ced

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/window/proxywindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,8 @@ void ProxyWindowAttached::updateWindow() {
542542
void ProxyWindowAttached::setWindow(ProxyWindowBase* window) {
543543
if (window == this->mWindow) return;
544544
this->mWindow = window;
545-
this->mWindowInterface = window ? qobject_cast<WindowInterface*>(window->parent()) : nullptr;
545+
auto* parentInterface = window ? qobject_cast<WindowInterface*>(window->parent()) : nullptr;
546+
this->mWindowInterface = parentInterface ? static_cast<QObject*>(parentInterface) : window;
546547
emit this->windowChanged();
547548
}
548549

src/window/proxywindow.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class ProxyWindowAttached: public QsWindowAttached {
220220

221221
private:
222222
ProxyWindowBase* mWindow = nullptr;
223-
WindowInterface* mWindowInterface = nullptr;
223+
QObject* mWindowInterface = nullptr;
224224

225225
void setWindow(ProxyWindowBase* window);
226226
};

0 commit comments

Comments
 (0)