Skip to content

Commit 259373e

Browse files
committed
fix: DNotitlebarWindowHelper can't be removed from mapped
qobject_cast<QWindow*>(window) is returned nullptr if window is destroyed in qt6, and we can see it on tst_QWindow::qobject_castOnDestruction() in tst_qwindow.cpp. pms: BUG-299239
1 parent edef78c commit 259373e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

wayland/dwayland/dnotitlebarwindowhelper_wl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ DNoTitlebarWlWindowHelper::~DNoTitlebarWlWindowHelper()
5050
VtableHook::resetVtable(m_window);
5151
}
5252

53-
mapped.remove(qobject_cast<QWindow*>(parent()));
53+
mapped.remove(static_cast<QWindow*>(parent()));
5454

5555
// TODO
5656
// if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性

xcb/dnotitlebarwindowhelper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ DNoTitlebarWindowHelper::~DNoTitlebarWindowHelper()
8585
VtableHook::resetVtable(m_window);
8686
}
8787

88-
mapped.remove(qobject_cast<QWindow*>(parent()));
88+
mapped.remove(static_cast<QWindow*>(parent()));
8989

9090
if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性
9191
Utility::clearWindowProperty(m_windowID, Utility::internAtom(_DEEPIN_SCISSOR_WINDOW));

0 commit comments

Comments
 (0)