Commit Graph

7 Commits

Author SHA1 Message Date
Sam Atkins
f2dd3d89d1 LibWeb/Gamepad: Ignore physical gamepads when running in test mode
This solves the issue where having a gamepad connected to a machine
running tests would cause different results for a few gamepad-related
tests.

Conveniently, all our fake testing gamepads are "virtual" in SDL, and
those are the only virtual ones.
2026-01-20 06:58:16 -05:00
Jelle Raaijmakers
097aaef648 LibWeb: Prevent race condition between ours and SDL's rumble duration
We fire a single shot timer to wait for the rumble to complete, so we
can call on_complete. SDL keeps an internal account of how long the
rumble should take and might, at that point, still be convinced the
gamepad should rumble. To prevent this race condition, explicitly cancel
the rumble ourselves.

Hopefully fixes the flakiness of
`Tests/LibWeb/Text/input/GamepadAPI/gamepad-rumble.html`.
2026-01-12 13:08:02 +00:00
Andreas Kling
2ac363dcba LibGC: Only call finalize() on types that override finalize()
This dramatically cuts down on time spent in the GC's finalizer pass,
since most types don't override finalize().
2026-01-07 20:51:17 +01:00
Tim Ledbetter
9c204f36ec LibWeb: Make eventInitDict GamepadEvent constructor parameter optional
This differs from the specification but matches the behavior of
existing implementations.
2025-09-23 16:04:56 +01:00
ayeteadoe
454e6a6f7f LibWeb/Gamepad: Forward declare SDL components to fix Windows build
We have to prevent from including any SDL headers in LibWeb headers.
Otherwise there will be transitive Windows.h includes that will
re-declare some of our existing forward decls/defines in
LibCore/SocketAddressWindows.h
2025-09-02 11:11:12 +01:00
Luke Wilde
74e0483ea5 LibWeb: Implement the Gamepad API with SDL3 2025-09-01 21:10:47 +02:00
Jelle Raaijmakers
526615bc10 LibWeb: Stub Navigator.getGamepads() 2025-07-22 11:55:29 -04:00