Skip to content

Commit

Permalink
fix: DNotitlebarWindowHelper can't be removed from mapped
Browse files Browse the repository at this point in the history
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
  • Loading branch information
18202781743 committed Jan 9, 2025
1 parent edef78c commit 259373e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wayland/dwayland/dnotitlebarwindowhelper_wl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ DNoTitlebarWlWindowHelper::~DNoTitlebarWlWindowHelper()
VtableHook::resetVtable(m_window);
}

mapped.remove(qobject_cast<QWindow*>(parent()));
mapped.remove(static_cast<QWindow*>(parent()));

// TODO
// if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性
Expand Down
2 changes: 1 addition & 1 deletion xcb/dnotitlebarwindowhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ DNoTitlebarWindowHelper::~DNoTitlebarWindowHelper()
VtableHook::resetVtable(m_window);
}

mapped.remove(qobject_cast<QWindow*>(parent()));
mapped.remove(static_cast<QWindow*>(parent()));

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

0 comments on commit 259373e

Please sign in to comment.