From eb266da10552eeefcb0f7dfe514d4385aec563f8 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周日, 03 12月 2023 05:05:23 +0800 Subject: [PATCH] Add windows context implementation --- src/core/contexts/abstractwindowcontext.cpp | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp index faac874..920e210 100644 --- a/src/core/contexts/abstractwindowcontext.cpp +++ b/src/core/contexts/abstractwindowcontext.cpp @@ -37,11 +37,12 @@ } else { m_hitTestVisibleRects.removeAll(rect); } + hitTestVisibleShapeDirty = true; return true; } bool AbstractWindowContext::setSystemButton(CoreWindowAgent::SystemButton button, - QObject *obj) { + QObject *obj) { Q_ASSERT(obj); Q_ASSERT(button != CoreWindowAgent::Unknown); if (!obj || (button == CoreWindowAgent::Unknown)) { @@ -72,4 +73,15 @@ // ? } + QRegion AbstractWindowContext::hitTestShape() const { + if (hitTestVisibleShapeDirty) { + hitTestVisibleShape = {}; + for (const auto &rect : m_hitTestVisibleRects) { + hitTestVisibleShape += rect; + } + hitTestVisibleShapeDirty = false; + } + return hitTestVisibleShape; + } + } \ No newline at end of file -- Gitblit v1.9.1