13 Commits

Author SHA1 Message Date
Lorn Potter
8375adcbe4 wasm: add dragleave event handling
Fixes: QTBUG-129149
Change-Id: I946f43e3a696c801a60a9a209a70ccaf57252a60
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 8a93093271329f1fb867c0627e63f61ed7330860)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-11 01:03:25 +00:00
Piotr Wierciński
03bd62e7c7 wasm: Only raise top level windows upon activation
Change-Id: Ied0ccfdc7bdb41d008ea38a6ece1e5483c0eda25
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-03-18 14:17:19 +01:00
Lorn Potter
e766df030b wasm: don't call requestActivate for windows that don't want it
QWindows that set Qt::QWindowDoesNotAcceptFocus like QtVirtualKeyboard
should not get focus.

gets rid of message:
requestActivate() called for  QtVirtualKeyboard::InputView(0x1cdf130)  which has Qt::WindowDoesNotAcceptFocus set.

Pick-to: 6.7
Change-Id: I649a8cff599769727beaeee11039cf1291fd502d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-01-10 05:44:16 +00:00
Shawn Rutledge
bc578ec6ef wasm: Handle stylus events by generating QTabletEvents
Pick-to: 6.6 6.7
Fixes: QTBUG-120327
Change-Id: I37a92b9850385712b638c30f9a43028d8134f416
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-12-28 06:11:59 +00:00
Lorn Potter
e62fd1b706 wasm: add QWasmDrag back to handle drag/drop
Change-Id: I7c577e6b13db9f5c51e5691baaf6417b956a5ff4
Done-with: Mikolaj.Boc@qt.io
Pick-to: 6.7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-12-21 17:24:42 +10:00
Lorn Potter
0367aace14 wasm: fix Pen input
This also adds the ability to distinguish between a Pen and a Touch.

Fixes: QTBUG-116989
Change-Id: Iffc5d20c9b46c1746a03c45dd12017d5dd5172a5
Pick-to: 6.6 6.7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-12-20 00:46:17 +00:00
Lorn Potter
585f348f3c wasm: add QWindow parameter to DragEvent
Perparing for enhanced Darg Drop support

Done-with: Mikolaj.Boc@qt.io
Change-Id: I24ce72570ce0754c8a5c152a92192eebeae5b340
Pick-to: 6.7
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-12-20 00:44:28 +00:00
Mikolaj Boc
73c0c798a0 Remove leftover code in QWasmWindowClientArea
Switch cases for EventType::PointerEnter and EventType::PointerLeave
are never reached.

Change-Id: I02f31c2d7064db740f21b014c9e0f4735a7a1a91
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2023-07-03 18:25:13 +02:00
Morten Sørvig
7a31911b79 wasm: fix touch -> mouse event synth on Safari
Mobile Safari generates touch pointer events with negative
pointer id's, which causes processTochEvent() to skip
the event instead of synthesizing a mouse event.

Ensure that the id's are always positive by taking the
absolute value of the event.

Pick-to: 6.6 6.5
Change-Id: I1514329dc76ecc4b9103f7deca9642aaf304df8b
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-06-28 17:24:19 +00:00
Mikolaj Boc
d34259d966 Stop propagation and default action on WASM window pointer event
The windows should not let events through to targets below (unless
they are Qt::WindowTransparentForInput, which is handled
independently). Therefore, stopPropagation and preventDefault are
now called regardless of whether the window has handled the event
or not. If the event is not handled explicitly, we still consume the
DOM event so that the windows/elements below don't get focus by
mistake.

Fixes: QTBUG-111706
Change-Id: Idc78ac5076e97992d9f6f13a1fa574d0df4178ac
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-03-28 16:31:17 +01:00
Mikolaj Boc
da5dc20625 Transfer touch event handling to QWasmWindow
Fixes: QTBUG-103498
Change-Id: Iec8b5cfba75131e7ddf855e6b729291950888fd3
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
2023-02-14 19:01:17 +01:00
Mikolaj Boc
d6eea89bc6 Use floating point coords for mouse/wheel events on wasm
Fractional mouse movements may be reported on hi-dpi. Floating point
event fields help us perform correct calculations in line with the
web platform.

Change-Id: Ic0c457db408c2bf28179ffcfdb032cde64ca8bbd
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
2023-02-14 07:34:25 +01:00
Mikolaj Boc
c15a8750bc 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 <morten.sorvig@qt.io>
2022-12-22 19:39:00 +01:00