This mouse actually enumerates as a gamepad with 2 axes, 8 buttons and a hat.
We'll ignore it like the other ROG mice, unless someone specifically wants to use it as a gamepad.
(cherry picked from commit edd044e90187528656327584b6e2337bbceacd57)
Rework the code to clearly prefer 64-bit sysctls first, then
legacy sysctls, and eliminate a second ifdef.
Signed-off-by: Nia Alarie <nia@NetBSD.org>
(cherry picked from commit 69cae07cc1c216e35ddf3df98048378ad7aeaf92)
`driverdata->width` and `driverdata->height` represent the width and height in logical pixels on scaled outputs with xdg_output. However, to correctly calculate the display's DPI value, we need to use its native resolution.
For example, on a 27" 4K screen with 175% scaling, we have `width` == 2192 and `height` == 1233, resulting in a bogus value of 92dpi, whereas 162dpi are correct for 3840x2160 pixels at 27 inches.
Tested on GNOME mutter 45.1.
This makes sure you can hit Ctrl-C if you don't have permission to access the raw keyboard device.
Fixes https://github.com/libsdl-org/SDL/issues/4812
(cherry picked from commit ce9e1bd32485ae8a024d8147e3aa3a36f0cb0a19)
At the point we're calling SDL_IsJoystickXboxSeriesX(), we don't know for sure that the controller is an Xbox controller.
Fixes https://github.com/libsdl-org/SDL/issues/8174
(cherry picked from commit 15bc12165ab56e6fbf93b8f3d18f2a0bb5854d8c)
Existing code is erroneous, because it adds or removes dependency's ref count based on number of InitSubSystem/QuitSubSystem calls, while ref count diff should depend on number of inited or quit dependents.
Recursive approach seems to be simplest solution that guarantees proper ref count.
Emscripten was using its own, private integer in order to allocate
new SDL_JoystickIDs. SDL keeps a similar integer for allocating
joystick-ids, one which is shared across multiple joystick backends.
SDL 2.0.13 introduces a new joystick-backend, a Virtual joystick
backend, which allows for software-driven joysticks, and which is
designed to sit alongside joystick-backends that provide access to
physical joysticks.
The Emscripten and the Virtual backends were, at times, getting
allocated the same SDL_JoystickIDs, if and when both backends were used
simultaneously. This could happen if, for example, an application
was using a virtual joystick in order to drive a touch-screen
based joystick, while also supporting physical joysticks through the
Emscripten backend.
When two joysticks end up with the same SDL_JoystickID, conflicts
can occur. For example, disconnecting a physical joystick with
the same SDL_JoystickID as a virtual one, can lead to the virtual
joystick being closed, inadvertently.
This fix makes the Emscripten backend use SDL's cross-joystick-backend
integer counter, which is shared among joystick backends, for allocating
new SDL_JoystickIDs, rather than a private, Emscripten-specific
counter.
Fixes https://github.com/libsdl-org/SDL/issues/3647
(cherry picked from commit 07cb7c10a15b95387431bcb3a1ae77cfd432707b)
(This fix was originally from @themightyoarfish on GitHub. Thanks!)
Fixes#8428.
Reference PR #8431.
(cherry picked from commit c6d9fb1ad71462bc844c6ca41e2ac7fe7cec3883)
GetRawInputDeviceList() can return a different number of devices than was allocated.
Fixes https://github.com/libsdl-org/SDL/issues/2759
(cherry picked from commit b9784feb2467dbb4cdc2474aa78098cd4f0b1630)
This reverts commit e5a15f94e2f1a8fbbffb25ea9932cda9679a68fd.
It turns out removing this check allows mice like the ROG PUGIO II to show up as game controllers. We need to find a different way to differentiate between gaming mice and pedals.
Since these mice show up as controllers, and potentially causing games to use them instead of real controllers, we'll go ahead revert this change for now.
Reopens https://github.com/libsdl-org/SDL/issues/8227
(cherry picked from commit ad0af488837e44cbea0f0eab3b2f73b50a74bff4)