From 40d73269371a9e2b142eb2be2bd2f70aff6346d2 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周日, 25 2月 2024 04:13:02 +0800 Subject: [PATCH] Better workaround for win10 top border issue --- src/core/contexts/abstractwindowcontext.cpp | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp index 3b441c0..1c11015 100644 --- a/src/core/contexts/abstractwindowcontext.cpp +++ b/src/core/contexts/abstractwindowcontext.cpp @@ -185,7 +185,7 @@ void AbstractWindowContext::virtual_hook(int id, void *data) { switch (id) { case CentralizeHook: { - if (!m_windowHandle) + if (!m_windowId) return; QRect windowGeometry = m_delegate->getGeometry(m_host); @@ -199,7 +199,7 @@ } case RaiseWindowHook: { - if (!m_windowHandle) + if (!m_windowId) return; m_delegate->setWindowVisible(m_host, true); @@ -260,6 +260,12 @@ m_windowAttributes.insert(it.key(), it.value()); } } + + // Send to shared dispatchers + if (oldWinId != m_windowId) { + QEvent e(QEvent::WinIdChange); + sharedDispatch(m_host, &e); + } } QVariant AbstractWindowContext::windowAttribute(const QString &key) const { -- Gitblit v1.9.1