diff options
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmcompositor.h')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmcompositor.h | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.h b/src/plugins/platforms/wasm/qwasmcompositor.h index 7d3ea52b39..0f24a6690e 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.h +++ b/src/plugins/platforms/wasm/qwasmcompositor.h @@ -9,12 +9,15 @@ #include <qpa/qplatformwindow.h> #include <QMap> +#include <tuple> QT_BEGIN_NAMESPACE class QWasmWindow; class QWasmScreen; +enum class QWasmWindowTreeNodeChangeType; + class QWasmCompositor final : public QObject { Q_OBJECT @@ -22,46 +25,35 @@ public: QWasmCompositor(QWasmScreen *screen); ~QWasmCompositor() final; - void addWindow(QWasmWindow *window); - void removeWindow(QWasmWindow *window); - void setVisible(QWasmWindow *window, bool visible); - void setActive(QWasmWindow *window); - void raise(QWasmWindow *window); - void lower(QWasmWindow *window); - void windowPositionPreferenceChanged(QWasmWindow *window, Qt::WindowFlags flags); - QWindow *windowAt(QPoint globalPoint, int padding = 0) const; - QWindow *keyWindow() const; + void onScreenDeleting(); QWasmScreen *screen(); + void setEnabled(bool enabled); - enum UpdateRequestDeliveryType { ExposeEventDelivery, UpdateRequestDelivery }; + static bool releaseRequestUpdateHold(); - void requestUpdateWindow(QWasmWindow *window, UpdateRequestDeliveryType updateType = ExposeEventDelivery); + void requestUpdate(); + enum UpdateRequestDeliveryType { ExposeEventDelivery, UpdateRequestDelivery }; + void requestUpdateWindow(QWasmWindow *window, const QRect &updateRect, UpdateRequestDeliveryType updateType = ExposeEventDelivery); - void handleBackingStoreFlush(QWindow *window); + void handleBackingStoreFlush(QWindow *window, const QRect &updateRect); + void onWindowTreeChanged(QWasmWindowTreeNodeChangeType changeType, QWasmWindow *window); private: void frame(const QList<QWasmWindow *> &windows); - void onTopWindowChanged(); - void deregisterEventHandlers(); - void requestUpdate(); void deliverUpdateRequests(); - void deliverUpdateRequest(QWasmWindow *window, UpdateRequestDeliveryType updateType); - - void updateEnabledState(); - - QWasmWindowStack m_windowStack; - QWasmWindow *m_activeWindow = nullptr; + void deliverUpdateRequest(QWasmWindow *window, const QRect &updateRect, UpdateRequestDeliveryType updateType); bool m_isEnabled = true; - QMap<QWasmWindow *, UpdateRequestDeliveryType> m_requestUpdateWindows; + QMap<QWasmWindow *, std::tuple<QRect, UpdateRequestDeliveryType>> m_requestUpdateWindows; int m_requestAnimationFrameId = -1; bool m_inDeliverUpdateRequest = false; + static bool m_requestUpdateHoldEnabled; }; QT_END_NAMESPACE |