core/window: move input mask handling + commit scheduling to polish

This commit is contained in:
outfoxxed 2025-01-20 00:51:56 -08:00
parent d6b58521e9
commit 6464ead0f1
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
7 changed files with 76 additions and 32 deletions

View file

@ -20,6 +20,7 @@
#include "windowinterface.hpp"
class ProxiedWindow;
class ProxyWindowContentItem;
// Proxy to an actual window exposing a limited property set with the ability to
// transfer it to a new window.
@ -85,6 +86,8 @@ public:
virtual void setVisible(bool visible);
virtual void setVisibleDirect(bool visible);
void schedulePolish();
[[nodiscard]] virtual qint32 x() const;
[[nodiscard]] virtual qint32 y() const;
@ -124,6 +127,7 @@ signals:
void colorChanged();
void maskChanged();
void surfaceFormatChanged();
void polished();
protected slots:
virtual void onWidthChanged();
@ -131,6 +135,7 @@ protected slots:
void onMaskChanged();
void onMaskDestroyed();
void onScreenDestroyed();
void onPolished();
void runLints();
protected:
@ -141,12 +146,16 @@ protected:
QColor mColor = Qt::white;
PendingRegion* mMask = nullptr;
ProxiedWindow* window = nullptr;
QQuickItem* mContentItem = nullptr;
ProxyWindowContentItem* mContentItem = nullptr;
bool reloadComplete = false;
bool ranLints = false;
QsSurfaceFormat qsSurfaceFormat;
QSurfaceFormat mSurfaceFormat;
struct {
bool inputMask : 1 = false;
} pendingPolish;
private:
void polishItems();
void updateMask();
@ -190,3 +199,13 @@ protected:
private:
ProxyWindowBase* mProxy;
};
class ProxyWindowContentItem: public QQuickItem {
Q_OBJECT;
signals:
void polished();
protected:
void updatePolish() override;
};