From acece00ae291d143c3b712a98814a64b9dd43f14 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 11 12月 2023 17:12:41 +0800
Subject: [PATCH] Remove VersionHelper

---
 src/core/contexts/abstractwindowcontext.cpp |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp
index 71431ff..e1187fa 100644
--- a/src/core/contexts/abstractwindowcontext.cpp
+++ b/src/core/contexts/abstractwindowcontext.cpp
@@ -61,7 +61,7 @@
     }
 
     bool AbstractWindowContext::setSystemButton(WindowAgentBase::SystemButton button,
-                                                const QObject *obj) {
+                                                QObject *obj) {
         Q_ASSERT(obj);
         Q_ASSERT(button != WindowAgentBase::Unknown);
         if (!obj || (button == WindowAgentBase::Unknown)) {
@@ -75,7 +75,7 @@
         return true;
     }
 
-    bool AbstractWindowContext::setTitleBar(const QObject *item) {
+    bool AbstractWindowContext::setTitleBar(QObject *item) {
         Q_ASSERT(item);
         if (!item) {
             return false;
@@ -88,7 +88,9 @@
         return true;
     }
 
-    void AbstractWindowContext::showSystemMenu(const QPoint &pos){Q_UNUSED(pos)}
+    void AbstractWindowContext::showSystemMenu(const QPoint &pos) {
+        virtual_hook(ShowSystemMenuHook, &const_cast<QPoint &>(pos));
+    }
 
     QRegion AbstractWindowContext::hitTestShape() const {
         if (hitTestVisibleShapeDirty) {
@@ -162,8 +164,20 @@
         return true;
     }
 
-    QObject *AbstractWindowContext::target() const {
-        return m_host;
+    QString AbstractWindowContext::key() const {
+        return {};
+    }
+
+    void AbstractWindowContext::virtual_hook(int id, void *data) {
+        switch (id) {
+            case NeedsDrawBordersHook: {
+                auto &result = *reinterpret_cast<bool *>(data);
+                result = false;
+                break;
+            }
+            default:
+                break;
+        }
     }
 
 }
\ No newline at end of file

--
Gitblit v1.9.1