Commit Graph

23 Commits

Author SHA1 Message Date
Sylvain 1d7966df15
Remove un-needed check for NULL pointer. They were previously checked just before. 2022-11-16 21:27:16 +01:00
Sam Lantinga 5c4fff7f63 Don't fail to get battery status if the upower refresh call fails 2022-02-04 14:02:44 -08:00
Sam Lantinga 03c4405b3b Fixed D-Bus battery refresh call 2022-02-01 09:33:18 -08:00
Sam Lantinga ec8e3104c8 Refresh the battery state before we query it on Linux 2022-01-31 17:01:08 -08:00
Sam Lantinga 120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
Sylvain d31251b014 use SDL's functions version inplace of libc version 2021-11-22 08:38:46 -08:00
Sam Lantinga 345c161feb Fixed some accidental uses of external C runtime functions 2021-09-22 09:06:45 -07:00
Sam Lantinga bf97c5a22f Make sure SDL file descriptors don't leak into child processes 2021-09-08 14:47:40 -07:00
Sam Lantinga 9130f7c377 Updated copyright for 2021 2021-01-02 10:25:38 -08:00
Sam Lantinga a8780c6a28 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Sam Lantinga 58a11d30de Fixed bug 4920 - Wider support for seconds of battery life left on Linux platforms using sys interface
Murad

On my system, SDL_GetPowerInfo() returns -1 seconds of battery life left. I have quickly investigated that in my case SDL uses sys interface to get battery data. It tries to read "time_to_empty_now" file which is not always present. However, it is still possible to calculate remaining lifetime using "energy_now" and "power_now" files. This is what my simple patch (included as attachment) tries to accomplish.
Best wishes.
2019-12-30 13:21:47 -08:00
Sylvain Becker 25d53a4475 SDL_syspower.c: remove redundant expression 2019-10-30 16:12:39 +01:00
Sylvain Becker ff0d9245a9 SDL_syspower: remove dead store warning
Value stored to 'str' during its initialization is never read
2019-10-30 14:26:18 +01:00
Sam Lantinga 5e13087b0f Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Sam Lantinga a9ae1b508d Handle NULL return from SDL_DBus_GetContext() 2018-04-23 20:24:12 -07:00
Sam Lantinga e3cc5b2c6b Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Ryan C. Gordon b36755a3fc power: whoops, that should be "==" not "!=". 2017-07-03 16:45:12 -04:00
Ryan C. Gordon c27dc51478 power: Linux /sys/class testing should skip "device" scopes.
(the PS4 game controllers report their batteries through this interface, which
is cool, but not helpful for powering the rest of the system.  :)   )
2017-07-03 16:38:37 -04:00
Ryan C. Gordon 643f1cb73d power: Add Linux org.freedesktop.UPower D-Bus implementation.
Fixes Bugzilla #3485.

(I think.)
2017-05-28 07:14:11 -04:00
Sam Lantinga 45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga 57d01d7d67 Patch from Sylvain to fix clang warnings 2016-11-13 22:57:41 -08:00
Sam Lantinga 42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann 0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00