[vlc-commits] [Git][videolan/vlc][master] inhibit/dbus: fix service and path

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Feb 25 12:40:23 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
77a2d21b by Andrew Sun at 2023-02-25T11:57:36+00:00
inhibit/dbus: fix service and path

According to https://web.archive.org/web/20080828095706/https://people.freedesktop.org/~hughsient/temp/power-management-spec-0.2.html the correct service name does not include `.Inhibit` and the path includes `/Inhibit`.

This essentially reverts beec9e78518b56e7f4db897b55b5e0d46ae61bf8

- - - - -


1 changed file:

- modules/misc/inhibit/dbus.c


Changes:

=====================================
modules/misc/inhibit/dbus.c
=====================================
@@ -39,15 +39,22 @@
 enum vlc_inhibit_api
 {
     FDO_SS, /**< KDE >= 4 and GNOME >= 3.10 */
-    FDO_PM, /**< KDE and GNOME <= 2.26 */
+    FDO_PM, /**< KDE and GNOME <= 2.26 and Xfce */
     MATE,  /**< >= 1.0 */
     GNOME, /**< GNOME 2.26..3.4 */
 };
 
 #define MAX_API (GNOME+1)
 
-/* Currently, all services have identical service and interface names. */
 static const char dbus_service[][40] =
+{
+    [FDO_SS] = "org.freedesktop.ScreenSaver",
+    [FDO_PM] = "org.freedesktop.PowerManagement",
+    [MATE]   = "org.mate.SessionManager",
+    [GNOME]  = "org.gnome.SessionManager",
+};
+
+static const char dbus_interface[][40] =
 {
     [FDO_SS] = "org.freedesktop.ScreenSaver",
     [FDO_PM] = "org.freedesktop.PowerManagement.Inhibit",
@@ -55,10 +62,10 @@ static const char dbus_service[][40] =
     [GNOME]  = "org.gnome.SessionManager",
 };
 
-static const char dbus_path[][33] =
+static const char dbus_path[][41] =
 {
     [FDO_SS] = "/ScreenSaver",
-    [FDO_PM] = "/org/freedesktop/PowerManagement",
+    [FDO_PM] = "/org/freedesktop/PowerManagement/Inhibit",
     [MATE]   = "/org/mate/SessionManager",
     [GNOME]  = "/org/gnome/SessionManager",
 };
@@ -119,7 +126,7 @@ static void Inhibit(vlc_inhibit_t *ih, unsigned flags)
     dbus_bool_t ret;
 
     DBusMessage *msg = dbus_message_new_method_call(dbus_service[type],
-                                  dbus_path[type], dbus_service[type], method);
+                                  dbus_path[type], dbus_interface[type], method);
     if (unlikely(msg == NULL))
         return;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/77a2d21b59fb9f1991608009c00931a1dab0ea3e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/77a2d21b59fb9f1991608009c00931a1dab0ea3e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list