summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2018-01-29 14:52:06 +0800
committerJonas Ådahl <jadahl@gmail.com>2018-02-23 19:33:31 +0800
commite502adfa043ba94f99b8eb16a6a72dad5c74a4a4 (patch)
tree99c260d5c5d44e095c597419c9d607d8d98bcdc8
parent8dd377da384b308e87aee21cf50f4a9c6620aa0a (diff)
downloadmutter-e502adfa043ba94f99b8eb16a6a72dad5c74a4a4.tar.gz
remote-desktop, screen-cast: Add version number to D-Bus APIs
In order to let applications gracefully handle version mismatches, add a version property to the APIs. Also add a warning on the APIs that these are not meant for public consumption.
-rw-r--r--src/backends/meta-remote-desktop.c4
-rw-r--r--src/backends/meta-screen-cast.c4
-rw-r--r--src/org.gnome.Mutter.RemoteDesktop.xml10
-rw-r--r--src/org.gnome.Mutter.ScreenCast.xml10
4 files changed, 28 insertions, 0 deletions
diff --git a/src/backends/meta-remote-desktop.c b/src/backends/meta-remote-desktop.c
index 1282818c0..0d454c4f1 100644
--- a/src/backends/meta-remote-desktop.c
+++ b/src/backends/meta-remote-desktop.c
@@ -42,6 +42,7 @@
#define META_REMOTE_DESKTOP_DBUS_SERVICE "org.gnome.Mutter.RemoteDesktop"
#define META_REMOTE_DESKTOP_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop"
+#define META_REMOTE_DESKTOP_API_VERSION 1
typedef enum _MetaRemoteDesktopDeviceTypes
{
@@ -262,6 +263,9 @@ meta_remote_desktop_init (MetaRemoteDesktop *remote_desktop)
meta_dbus_remote_desktop_set_supported_device_types (
META_DBUS_REMOTE_DESKTOP (remote_desktop),
calculate_supported_device_types ());
+ meta_dbus_remote_desktop_set_version (
+ META_DBUS_REMOTE_DESKTOP (remote_desktop),
+ META_REMOTE_DESKTOP_API_VERSION);
}
static void
diff --git a/src/backends/meta-screen-cast.c b/src/backends/meta-screen-cast.c
index 3d12c1e32..4a67683e7 100644
--- a/src/backends/meta-screen-cast.c
+++ b/src/backends/meta-screen-cast.c
@@ -32,6 +32,7 @@
#define META_SCREEN_CAST_DBUS_SERVICE "org.gnome.Mutter.ScreenCast"
#define META_SCREEN_CAST_DBUS_PATH "/org/gnome/Mutter/ScreenCast"
+#define META_SCREEN_CAST_API_VERSION 1
struct _MetaScreenCast
{
@@ -264,6 +265,9 @@ meta_screen_cast_init (MetaScreenCast *screen_cast)
pw_init (NULL, NULL);
is_pipewire_initialized = TRUE;
}
+
+ meta_dbus_screen_cast_set_version (META_DBUS_SCREEN_CAST (screen_cast),
+ META_SCREEN_CAST_API_VERSION);
}
static void
diff --git a/src/org.gnome.Mutter.RemoteDesktop.xml b/src/org.gnome.Mutter.RemoteDesktop.xml
index dc86cf342..2592e9808 100644
--- a/src/org.gnome.Mutter.RemoteDesktop.xml
+++ b/src/org.gnome.Mutter.RemoteDesktop.xml
@@ -6,6 +6,10 @@
<!--
org.gnome.Mutter.RemoteDesktop:
@short_description: Remote desktop interface
+
+ This API is private and not intended to be used outside of the integrated
+ system that uses libmutter. No compatibility between versions are
+ promised.
-->
<interface name="org.gnome.Mutter.RemoteDesktop">
@@ -28,6 +32,12 @@
-->
<property name="SupportedDeviceTypes" type="u" access="read" />
+ <!--
+ Version:
+ @short_description: API version
+ -->
+ <property name="Version" type="i" access="read" />
+
</interface>
<!--
diff --git a/src/org.gnome.Mutter.ScreenCast.xml b/src/org.gnome.Mutter.ScreenCast.xml
index 409247b03..61345564b 100644
--- a/src/org.gnome.Mutter.ScreenCast.xml
+++ b/src/org.gnome.Mutter.ScreenCast.xml
@@ -6,6 +6,10 @@
<!--
org.gnome.Mutter.ScreenCast:
@short_description: Screen cast interface
+
+ This API is private and not intended to be used outside of the integrated
+ system that uses libmutter. No compatibility between versions are
+ promised.
-->
<interface name="org.gnome.Mutter.ScreenCast">
@@ -24,6 +28,12 @@
<arg name="session_path" type="o" direction="out" />
</method>
+ <!--
+ Version:
+ @short_description: API version
+ -->
+ <property name="Version" type="i" access="read" />
+
</interface>
<!--