From 8c403d5dd03418febd67d50c6d9094a61c036f9b Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 11 12月 2023 14:43:40 +0800
Subject: [PATCH] Add virtual hook

---
 src/core/contexts/abstractwindowcontext.cpp |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp
index 71431ff..d60a6c7 100644
--- a/src/core/contexts/abstractwindowcontext.cpp
+++ b/src/core/contexts/abstractwindowcontext.cpp
@@ -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,17 @@
         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 CentralizeHook:
+                break;
+            default:
+                break;
+        }
     }
 
 }
\ No newline at end of file

--
Gitblit v1.9.1