Commit 03c4405b3b5fac46a86ec8c6c20884db490b478a

Sam Lantinga 2022-02-01T09:32:38

Fixed D-Bus battery refresh call

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/power/linux/SDL_syspower.c b/src/power/linux/SDL_syspower.c
index 92a66ba..1f238c5 100644
--- a/src/power/linux/SDL_syspower.c
+++ b/src/power/linux/SDL_syspower.c
@@ -565,7 +565,7 @@ check_upower_device(DBusConnection *conn, const char *path, SDL_PowerState *stat
         return;
     } else if (!ui32) {
         st = SDL_POWERSTATE_NO_BATTERY;
-    } else if (!SDL_DBus_CallMethodOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "Refresh", DBUS_TYPE_INVALID)) {
+    } else if (!SDL_DBus_CallMethodOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "Refresh", DBUS_TYPE_INVALID, DBUS_TYPE_INVALID)) {
 	return;
     } else if (!SDL_DBus_QueryPropertyOnConnection(conn, UPOWER_DBUS_NODE, path, UPOWER_DEVICE_DBUS_INTERFACE, "State", DBUS_TYPE_UINT32, &ui32)) {
         st = SDL_POWERSTATE_UNKNOWN;  /* uh oh */