Commit 5fe4b004 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

dbus_screensaver: add o.fd.ScreenSaver support (fixes #7824)

parent dfc527fe
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
enum vlc_inhibit_api enum vlc_inhibit_api
{ {
FREEDESKTOP, /* KDE and GNOME <= 2.26 */ FDO_SS, /**< KDE >= 4 and GNOME >= 3.6 */
FDO_PM, /**< KDE and GNOME <= 2.26 */
GNOME, /**< GNOME 2.26..3.4 */ GNOME, /**< GNOME 2.26..3.4 */
}; };
...@@ -46,26 +47,30 @@ enum vlc_inhibit_api ...@@ -46,26 +47,30 @@ enum vlc_inhibit_api
static const char dbus_service[][32] = static const char dbus_service[][32] =
{ {
[FREEDESKTOP] = "org.freedesktop.PowerManagement", [FDO_SS] = "org.freedesktop.ScreenSaver",
[GNOME] = "org.gnome.SessionManager", [FDO_PM] = "org.freedesktop.PowerManagement",
[GNOME] = "org.gnome.SessionManager",
}; };
static const char dbus_path[][33] = static const char dbus_path[][33] =
{ {
[FREEDESKTOP] = "/org/freedesktop/PowerManagement", [FDO_SS] = "/ScreenSaver",
[GNOME] = "/org/gnome/SessionManager", [FDO_PM] = "/org/freedesktop/PowerManagement",
[GNOME] = "/org/gnome/SessionManager",
}; };
static const char dbus_interface[][40] = static const char dbus_interface[][40] =
{ {
[FREEDESKTOP] = "org.freedesktop.PowerManagement.Inhibit", [FDO_SS] = "org.freedesktop.ScreenSaver",
[GNOME] = "org.gnome.SessionManager", [FDO_PM] = "org.freedesktop.PowerManagement.Inhibit",
[GNOME] = "org.gnome.SessionManager",
}; };
static const char dbus_method_uninhibit[][10] = static const char dbus_method_uninhibit[][10] =
{ {
[FREEDESKTOP] = "UnInhibit", [FDO_SS] = "UnInhibit",
[GNOME] = "Uninhibit", [FDO_PM] = "UnInhibit",
[GNOME] = "Uninhibit",
}; };
struct vlc_inhibit_sys struct vlc_inhibit_sys
...@@ -129,11 +134,6 @@ static void Inhibit(vlc_inhibit_t *ih, unsigned flags) ...@@ -129,11 +134,6 @@ static void Inhibit(vlc_inhibit_t *ih, unsigned flags)
switch (type) switch (type)
{ {
case FREEDESKTOP:
ret = dbus_message_append_args(msg, DBUS_TYPE_STRING, &app,
DBUS_TYPE_STRING, &reason,
DBUS_TYPE_INVALID);
break;
case GNOME: case GNOME:
{ {
dbus_uint32_t xid = 0; // FIXME ? dbus_uint32_t xid = 0; // FIXME ?
...@@ -147,7 +147,10 @@ static void Inhibit(vlc_inhibit_t *ih, unsigned flags) ...@@ -147,7 +147,10 @@ static void Inhibit(vlc_inhibit_t *ih, unsigned flags)
break; break;
} }
default: default:
assert(0); ret = dbus_message_append_args(msg, DBUS_TYPE_STRING, &app,
DBUS_TYPE_STRING, &reason,
DBUS_TYPE_INVALID);
break;
} }
if (!ret if (!ret
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment