diff options
| author | Mikolaj Boc <[email protected]> | 2022-12-20 15:56:49 +0100 | 
|---|---|---|
| committer | Mikolaj Boc <[email protected]> | 2022-12-22 19:39:00 +0100 | 
| commit | c15a8750bcce3d4dabeebcc8bb4c15db31c7f637 (patch) | |
| tree | 6e9eccefbe350488b4c2d51fbd142a0b19e86d19 /src/plugins/platforms/wasm/qwasmwindow.h | |
| parent | cf2651ae80a34b388a6bbb41b5e62c7b352e8a80 (diff) | |
Handle the mouse events in the window itself
It is now not the screen that handles all of the events and relays
them to individual windows, but the window elements themselves.
This allows us to get rid of manual window targeting logic and let
the browser do its job.
Fixes: QTBUG-107217
Pick-to: 6.5
Change-Id: I4dc5a74b1343f027f72c1da4623b99cd28bfbb38
Reviewed-by: Morten Johan Sørvig <[email protected]>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmwindow.h')
| -rw-r--r-- | src/plugins/platforms/wasm/qwasmwindow.h | 17 | 
1 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h index d5a902e8b09..af0353924f0 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.h +++ b/src/plugins/platforms/wasm/qwasmwindow.h @@ -20,6 +20,12 @@  QT_BEGIN_NAMESPACE +namespace qstdweb { +class EventCallback; +} + +class ClientArea; +  class QWasmWindow final : public QPlatformWindow  {  public: @@ -59,7 +65,6 @@ public:      bool setKeyboardGrabEnabled(bool) override { return false; }      bool setMouseGrabEnabled(bool grab) final;      bool windowEvent(QEvent *event) final; -    bool startSystemResize(Qt::Edges edges) final;      QWasmScreen *platformScreen() const;      void setBackingStore(QWasmBackingStore *store) { m_backingStore = store; } @@ -76,6 +81,8 @@ private:      bool hasTitleBar() const;      void applyWindowState(); +    bool processPointer(const PointerEvent &event); +      QWindow *m_window = nullptr;      QWasmCompositor *m_compositor = nullptr;      QWasmBackingStore *m_backingStore = nullptr; @@ -89,13 +96,21 @@ private:      emscripten::val m_context2d = emscripten::val::undefined();      std::unique_ptr<NonClientArea> m_nonClientArea; +    std::unique_ptr<ClientArea> m_clientArea; + +    std::unique_ptr<qstdweb::EventCallback> m_pointerLeaveCallback; +    std::unique_ptr<qstdweb::EventCallback> m_pointerEnterCallback; +    std::unique_ptr<qstdweb::EventCallback> m_pointerMoveCallback;      Qt::WindowStates m_state = Qt::WindowNoState;      Qt::WindowStates m_previousWindowState = Qt::WindowNoState;      Qt::WindowFlags m_flags = Qt::Widget; +    QPoint m_lastPointerMovePoint; +      WId m_winId = 0; +    bool m_wantCapture = false;      bool m_hasTitle = false;      bool m_needsCompositor = false;      long m_requestAnimationFrameId = -1;  | 
