From ed5f9693b3cd7ddcdc746c4bb65dcd9cf7a8268b Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周二, 19 12月 2023 15:09:49 +0800
Subject: [PATCH] Add window attributes

---
 src/core/contexts/abstractwindowcontext.cpp |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp
index d34a1f9..a62d037 100644
--- a/src/core/contexts/abstractwindowcontext.cpp
+++ b/src/core/contexts/abstractwindowcontext.cpp
@@ -23,6 +23,21 @@
         }
     }
 
+    void AbstractWindowContext::setWindowAttribute(const QString &key, const QVariant &var) {
+        auto it = m_windowAttributes.find(key);
+        if (it.value() == var)
+            return;
+
+        auto newVar = var;
+        auto oldVar = it.value();
+        void *a[] = {
+            &const_cast<QString &>(key),
+            &newVar,
+            &oldVar,
+        };
+        virtual_hook(WindowAttributeChangedHook, a);
+    }
+
     bool AbstractWindowContext::setHitTestVisible(const QObject *obj, bool visible) {
         Q_ASSERT(obj);
         if (!obj) {

--
Gitblit v1.9.1