summaryrefslogtreecommitdiff
path: root/plugins/screensaver-proxy
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-09-03 04:24:35 +0200
committerBastien Nocera <hadess@hadess.net>2013-09-03 04:45:21 +0200
commitfd0e2b107cdf5e82a034fc9a30753259ecc3d267 (patch)
treea9f054c5ed1feb0424c18c546a7ca517c7726385 /plugins/screensaver-proxy
parent15bdd5e198435ff16fc4ae9804c1adac97ec75e7 (diff)
downloadgnome-settings-daemon-fd0e2b107cdf5e82a034fc9a30753259ecc3d267.tar.gz
screensaver-proxy: Support the KDE interface as well
KDE uses the non-namespaced interface path "/ScreenSaver" instead of the correct "/org/freedesktop/ScreenSaver": https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/100c4ccc/entry/ksmserver/screenlocker/interface.cpp#L51 So support that as well...
Diffstat (limited to 'plugins/screensaver-proxy')
-rw-r--r--plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c b/plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c
index 5005c1f5..9f36b63c 100644
--- a/plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c
+++ b/plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c
@@ -83,9 +83,50 @@ static const gchar introspection_xml[] =
"</signal>"
"</interface>"
"</node>";
+static const gchar introspection_xml2[] =
+"<node name='/ScreenSaver'>"
+ "<interface name='org.freedesktop.ScreenSaver'>"
+ "<method name='Lock'/>"
+ "<method name='SimulateUserActivity'/>"
+ "<method name='GetActive'>"
+ "<arg type='b' direction='out'/>"
+ "</method>"
+ "<method name='GetActiveTime'>"
+ "<arg name='seconds' type='u' direction='out'/>"
+ "</method>"
+ "<method name='GetSessionIdleTime'>"
+ "<arg name='seconds' type='u' direction='out'/>"
+ "</method>"
+ "<method name='SetActive'>"
+ "<arg type='b' direction='out'/>"
+ "<arg name='e' type='b' direction='in'/>"
+ "</method>"
+ "<method name='Inhibit'>"
+ "<arg name='application_name' type='s' direction='in'/>"
+ "<arg name='reason_for_inhibit' type='s' direction='in'/>"
+ "<arg name='cookie' type='u' direction='out'/>"
+ "</method>"
+ "<method name='UnInhibit'>"
+ "<arg name='cookie' type='u' direction='in'/>"
+ "</method>"
+ "<method name='Throttle'>"
+ "<arg name='application_name' type='s' direction='in'/>"
+ "<arg name='reason_for_inhibit' type='s' direction='in'/>"
+ "<arg name='cookie' type='u' direction='out'/>"
+ "</method>"
+ "<method name='UnThrottle'>"
+ "<arg name='cookie' type='u' direction='in'/>"
+ "</method>"
+
+ "<signal name='ActiveChanged'>"
+ "<arg type='b'/>"
+ "</signal>"
+ "</interface>"
+"</node>";
#define GSD_SCREENSAVER_PROXY_DBUS_SERVICE "org.freedesktop.ScreenSaver"
#define GSD_SCREENSAVER_PROXY_DBUS_PATH "/org/freedesktop/ScreenSaver"
+#define GSD_SCREENSAVER_PROXY_DBUS_PATH2 "/ScreenSaver"
#define GSD_SCREENSAVER_PROXY_DBUS_INTERFACE "org.freedesktop.ScreenSaver"
#define GSM_INHIBITOR_FLAG_IDLE 1 << 3
@@ -96,6 +137,7 @@ struct GsdScreensaverProxyManagerPrivate
GDBusConnection *connection;
GCancellable *bus_cancellable;
GDBusNodeInfo *introspection_data;
+ GDBusNodeInfo *introspection_data2;
guint name_id;
GHashTable *watch_ht; /* key = sender, value = name watch id */
@@ -270,6 +312,14 @@ on_bus_gotten (GObject *source_object,
manager,
NULL,
NULL);
+ infos = manager->priv->introspection_data2->interfaces;
+ g_dbus_connection_register_object (connection,
+ GSD_SCREENSAVER_PROXY_DBUS_PATH2,
+ infos[0],
+ &interface_vtable,
+ manager,
+ NULL,
+ NULL);
manager->priv->name_id = g_bus_own_name_on_connection (manager->priv->connection,
GSD_SCREENSAVER_PROXY_DBUS_SERVICE,
@@ -284,8 +334,10 @@ static void
register_manager_dbus (GsdScreensaverProxyManager *manager)
{
manager->priv->introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
+ manager->priv->introspection_data2 = g_dbus_node_info_new_for_xml (introspection_xml2, NULL);
manager->priv->bus_cancellable = g_cancellable_new ();
g_assert (manager->priv->introspection_data != NULL);
+ g_assert (manager->priv->introspection_data2 != NULL);
g_bus_get (G_BUS_TYPE_SESSION,
manager->priv->bus_cancellable,
@@ -357,6 +409,7 @@ gsd_screensaver_proxy_manager_finalize (GObject *object)
g_clear_object (&manager->priv->connection);
g_clear_object (&manager->priv->bus_cancellable);
g_clear_pointer (&manager->priv->introspection_data, g_dbus_node_info_unref);
+ g_clear_pointer (&manager->priv->introspection_data2, g_dbus_node_info_unref);
G_OBJECT_CLASS (gsd_screensaver_proxy_manager_parent_class)->finalize (object);
}