From 7e132b345cc2b2515838c387a76ccc9f29705ba6 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周二, 19 12月 2023 03:12:59 +0800 Subject: [PATCH] Add fallback to qt window context --- src/core/contexts/abstractwindowcontext.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp index d69ab75..ef1efbf 100644 --- a/src/core/contexts/abstractwindowcontext.cpp +++ b/src/core/contexts/abstractwindowcontext.cpp @@ -19,8 +19,7 @@ m_delegate.reset(delegate); m_windowHandle = m_delegate->hostWindow(m_host); if (m_windowHandle) { - m_windowHandleGuard = m_windowHandle; - winIdChanged(nullptr, false); + winIdChanged(nullptr); } } @@ -176,7 +175,9 @@ void AbstractWindowContext::notifyWinIdChange() { auto oldWindow = m_windowHandle; m_windowHandle = m_delegate->window(m_host); - winIdChanged(oldWindow, oldWindow && m_windowHandleGuard.isNull()); + if (oldWindow == m_windowHandle) + return; + winIdChanged(oldWindow); } -} \ No newline at end of file +} -- Gitblit v1.9.1