Presumably this is an accidental character due to the copyright symbol and conversion to/from different encodings. The *.c file does not have this character.
On my laptop, the battery is configured to stop charging at around 80%
most of the time, to increase the overall useful lifetime of the battery.
When in that state, upower reports UP_DEVICE_STATE_PENDING_CHARGE
(numeric value 5), which SDL previously mapped to SDL_POWERSTATE_UNKNOWN.
This made the platform_testGetPowerInfo automated test fail, because
it assumes that SDL_POWERSTATE_UNKNOWN means no battery is connected,
and does not expect to see a percentage.
Map UP_DEVICE_STATE_PENDING_CHARGE (5) to SDL_POWERSTATE_CHARGED, which
seems close enough.
Also map UP_DEVICE_STATE_PENDING_DISCHARGE (6) to
SDL_POWERSTATE_ON_BATTERY, which matches how at least GNOME presents it.
Signed-off-by: Simon McVittie <smcv@collabora.com>
This fires if an opened device changes formats (which it can on Windows,
if the user changes this in the system control panel, and WASAPI can
report), or if a default device migrates to new hardware and the format
doesn't match.
This will fire for all logical devices on a physical device (and if it's
a format change and not a default device change, it'll fire for the
physical device too, but that's honestly not that useful and might change).
Fixes#8267.
("preconverted bytes" makes it sounds like we already converted them before
the call instead of "bytes that haven't yet hit the stage where we convert
them. Just dump the wording completely.)
Not destroying the windows, caused a leak in checkkeys when
exiting by clicking somewhere in the window:
Allocation 0: 8 bytes
0x7f46f56d2fe8: SDL_realloc_REAL+0x3d
0x7f46f565deb7: GetMouseInputSource+0x88
0x7f46f565e07b: SDL_PrivateSendMouseButton+0x56
0x7f46f565e5aa: SDL_SendMouseButton+0x44
0x7f46f57fb0a4: pointer_handle_button_common+0x1bb
0x7f46f57fb0f3: pointer_handle_button+0x41
0x7f46f5123be6: ffi_prep_go_closure+0x2c6
0x7f46f51204bf: SDL_InitSubSystem+0x19
0x7f46f512318e: ffi_call+0x12e
Since opening devices via libusb will unbind them from other drivers, we will either whitelist specific devices that we want to support via libusb or we will prefer other drivers over libusb.