kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/0010-screen-cast-session-Add-window-id-support.patch

776610
From 4487b25d277e9ef73b464eb6e2e8971e4e5b13ae Mon Sep 17 00:00:00 2001
776610
From: Olivier Fourdan <ofourdan@redhat.com>
776610
Date: Mon, 15 Oct 2018 12:08:29 +0200
776610
Subject: [PATCH 10/12] screen-cast-session: Add window-id support
776610
776610
Use the "window-id" property to select the window to cast using
776610
RecordWindow.
776610
776610
https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
776610
(cherry picked from commit c786b6c13cf9cb1bb9d7f7d2ca0ead0bf28a5fcd)
776610
---
776610
 src/backends/meta-screen-cast-session.c | 19 ++++++++++++++++++-
776610
 src/org.gnome.Mutter.ScreenCast.xml     |  5 ++++-
776610
 2 files changed, 22 insertions(+), 2 deletions(-)
776610
776610
diff --git a/src/backends/meta-screen-cast-session.c b/src/backends/meta-screen-cast-session.c
776610
index 3ee02c5..d0f5a79 100644
776610
--- a/src/backends/meta-screen-cast-session.c
776610
+++ b/src/backends/meta-screen-cast-session.c
776610
@@ -340,6 +340,7 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
776610
   MetaWindow *window;
776610
   GError *error = NULL;
776610
   MetaDisplay *display;
776610
+  GVariant *window_id_variant = NULL;
776610
   MetaScreenCastWindowStream *window_stream;
776610
   MetaScreenCastStream *stream;
776610
   char *stream_path;
776610
@@ -352,8 +353,24 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
776610
       return TRUE;
776610
     }
776610
 
776610
+  if (properties_variant)
776610
+    window_id_variant = g_variant_lookup_value (properties_variant,
776610
+                                                "window-id",
776610
+                                                G_VARIANT_TYPE ("t"));
776610
+
776610
   display = meta_get_display ();
776610
-  window = meta_display_get_focus_window (display);
776610
+  if (window_id_variant)
776610
+    {
776610
+      uint64_t window_id;
776610
+
776610
+      g_variant_get (window_id_variant, "t", &window_id);
776610
+      window = meta_display_get_window_from_id (display, window_id);
776610
+    }
776610
+  else
776610
+    {
776610
+      window = meta_display_get_focus_window (display);
776610
+    }
776610
+
776610
   if (!window)
776610
     {
776610
       g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
776610
diff --git a/src/org.gnome.Mutter.ScreenCast.xml b/src/org.gnome.Mutter.ScreenCast.xml
776610
index 6134556..3cd02b6 100644
776610
--- a/src/org.gnome.Mutter.ScreenCast.xml
776610
+++ b/src/org.gnome.Mutter.ScreenCast.xml
776610
@@ -86,7 +86,10 @@
776610
 
776610
 	Record a single window.
776610
 
776610
-	Available @properties include: (none)
776610
+	Available @properties include:
776610
+
776610
+	* "window-id" (t): Id of the window to record.
776610
+
776610
     -->
776610
     <method name="RecordWindow">
776610
       <arg name="properties" type="a{sv}" direction="in" />
776610
-- 
776610
2.19.2
776610