Sine Striker
2023-12-03 7a54badb4a5782c551deb2919f3c489fdb4fbc02
src/core/contexts/abstractwindowcontext_p.h
@@ -1,6 +1,9 @@
#ifndef ABSTRACTWINDOWCONTEXT_P_H
#define ABSTRACTWINDOWCONTEXT_P_H
#include <array>
#include <memory>
#include <QtCore/QSet>
#include <QtGui/QWindow>
#include <QtGui/QPolygon>
@@ -16,7 +19,7 @@
        inline AbstractWindowContext(QWindow *window, WindowItemDelegate *delegate)
            : m_windowHandle(window), m_delegate(delegate) {
        }
        ~AbstractWindowContext();
        ~AbstractWindowContext() override;
    public:
        virtual bool setup() = 0;
@@ -36,18 +39,22 @@
        void showSystemMenu(const QPoint &pos);
        QRegion hitTestShape() const;
        bool isInSystemButtons(const QPoint &pos, CoreWindowAgent::SystemButton *button) const;
    protected:
        QWindow *m_windowHandle;
        WindowItemDelegate *m_delegate;
        std::unique_ptr<WindowItemDelegate> m_delegate;
        QSet<QObject *> m_hitTestVisibleItems;
        QList<QRect> m_hitTestVisibleRects;
        QObject *m_titleBar{};
        QObject *m_systemButtons[CoreWindowAgent::NumSystemButton]{};
        std::array<QObject *, CoreWindowAgent::NumSystemButton> m_systemButtons{};
        // Cached shape
        mutable bool hitTestVisibleShapeDirty{};
        mutable QPolygon hitTestVisibleShape;
        mutable QRegion hitTestVisibleShape;
    };
    inline QWindow *AbstractWindowContext::window() const {