[vlc-commits] [Git][videolan/vlc][3.0.x] inhibit/dbus: fix service and path

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Mar 1 08:06:34 UTC 2023



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
eaa89a42 by Andrew Sun at 2023-03-01T06:33:35+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


(cherry picked from commit 77a2d21b59fb9f1991608009c00931a1dab0ea3e)
- - - - -


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/eaa89a42ae0d25fd5480e5f5212a6fb2055d9e7b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/eaa89a42ae0d25fd5480e5f5212a6fb2055d9e7b
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