Sine Striker
2023-12-04 41a4103ffcce0efb6d532a15d307ab98177c997e
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>
@@ -12,12 +15,9 @@
    class QWK_CORE_EXPORT AbstractWindowContext : public QObject {
        Q_OBJECT
        Q_DISABLE_COPY(AbstractWindowContext)
    public:
        inline AbstractWindowContext(QWindow *window, WindowItemDelegatePtr delegate)
            : m_windowHandle(window), m_delegate(std::move(delegate))
        {
        inline AbstractWindowContext(QWindow *window, WindowItemDelegate *delegate)
            : m_windowHandle(window), m_delegate(delegate) {
        }
        ~AbstractWindowContext() override;
@@ -39,9 +39,13 @@
        void showSystemMenu(const QPoint &pos);
        QRegion hitTestShape() const;
        bool isInSystemButtons(const QPoint &pos, CoreWindowAgent::SystemButton *button) const;
        bool isInTitleBarDraggableArea(const QPoint &pos) const;
    protected:
        QWindow *m_windowHandle;
        WindowItemDelegatePtr m_delegate;
        std::unique_ptr<WindowItemDelegate> m_delegate;
        QSet<QObject *> m_hitTestVisibleItems;
        QList<QRect> m_hitTestVisibleRects;
@@ -49,8 +53,9 @@
        QObject *m_titleBar{};
        std::array<QObject *, CoreWindowAgent::NumSystemButton> m_systemButtons{};
        // Cached shape
        mutable bool hitTestVisibleShapeDirty{};
        mutable QPolygon hitTestVisibleShape;
        mutable QRegion hitTestVisibleShape;
    };
    inline QWindow *AbstractWindowContext::window() const {
@@ -69,8 +74,6 @@
    inline QObject *AbstractWindowContext::titleBar() const {
        return m_titleBar;
    }
    using WindowContextPtr = std::shared_ptr<AbstractWindowContext>;
}