diff --git a/src/backends/meta-screen-cast-session.c b/src/backends/meta-screen-cast-session.c index 3ee02c552..d0f5a79d9 100644 --- a/src/backends/meta-screen-cast-session.c +++ b/src/backends/meta-screen-cast-session.c @@ -340,6 +340,7 @@ handle_record_window (MetaDBusScreenCastSession *skeleton, MetaWindow *window; GError *error = NULL; MetaDisplay *display; + GVariant *window_id_variant = NULL; MetaScreenCastWindowStream *window_stream; MetaScreenCastStream *stream; char *stream_path; @@ -352,8 +353,24 @@ handle_record_window (MetaDBusScreenCastSession *skeleton, return TRUE; } + if (properties_variant) + window_id_variant = g_variant_lookup_value (properties_variant, + "window-id", + G_VARIANT_TYPE ("t")); + display = meta_get_display (); - window = meta_display_get_focus_window (display); + if (window_id_variant) + { + uint64_t window_id; + + g_variant_get (window_id_variant, "t", &window_id); + window = meta_display_get_window_from_id (display, window_id); + } + else + { + window = meta_display_get_focus_window (display); + } + if (!window) { g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, diff --git a/src/org.gnome.Mutter.ScreenCast.xml b/src/org.gnome.Mutter.ScreenCast.xml index 61345564b..3cd02b6cb 100644 --- a/src/org.gnome.Mutter.ScreenCast.xml +++ b/src/org.gnome.Mutter.ScreenCast.xml @@ -86,7 +86,10 @@ Record a single window. - Available @properties include: (none) + Available @properties include: + + * "window-id" (t): Id of the window to record. + -->