From 259373eedce2a99ab7f6038d0eee9ce6ebcfeb17 Mon Sep 17 00:00:00 2001 From: YeShanShan Date: Thu, 9 Jan 2025 09:40:36 +0800 Subject: [PATCH] fix: DNotitlebarWindowHelper can't be removed from mapped qobject_cast(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 --- wayland/dwayland/dnotitlebarwindowhelper_wl.cpp | 2 +- xcb/dnotitlebarwindowhelper.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wayland/dwayland/dnotitlebarwindowhelper_wl.cpp b/wayland/dwayland/dnotitlebarwindowhelper_wl.cpp index 8ac68ace..5f85b16a 100644 --- a/wayland/dwayland/dnotitlebarwindowhelper_wl.cpp +++ b/wayland/dwayland/dnotitlebarwindowhelper_wl.cpp @@ -50,7 +50,7 @@ DNoTitlebarWlWindowHelper::~DNoTitlebarWlWindowHelper() VtableHook::resetVtable(m_window); } - mapped.remove(qobject_cast(parent())); + mapped.remove(static_cast(parent())); // TODO // if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性 diff --git a/xcb/dnotitlebarwindowhelper.cpp b/xcb/dnotitlebarwindowhelper.cpp index e7377691..fee76481 100644 --- a/xcb/dnotitlebarwindowhelper.cpp +++ b/xcb/dnotitlebarwindowhelper.cpp @@ -85,7 +85,7 @@ DNoTitlebarWindowHelper::~DNoTitlebarWindowHelper() VtableHook::resetVtable(m_window); } - mapped.remove(qobject_cast(parent())); + mapped.remove(static_cast(parent())); if (m_window->handle()) { // 当本地窗口还存在时,移除设置过的窗口属性 Utility::clearWindowProperty(m_windowID, Utility::internAtom(_DEEPIN_SCISSOR_WINDOW));