[mutter] screen-cast-monitor-stream: Don't pass monitor manager when creating



commit 08229a6f5d72683ec780edf5acf101ab0bed8867
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Dec 12 11:32:11 2018 +0100

    screen-cast-monitor-stream: Don't pass monitor manager when creating
    
    It can be fetched indirectly from the monitor already.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/357

 src/backends/meta-screen-cast-monitor-stream.c | 11 ++++++-----
 src/backends/meta-screen-cast-monitor-stream.h |  9 ++++-----
 src/backends/meta-screen-cast-session.c        |  1 -
 3 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/src/backends/meta-screen-cast-monitor-stream.c b/src/backends/meta-screen-cast-monitor-stream.c
index df43f977c..5a816e4df 100644
--- a/src/backends/meta-screen-cast-monitor-stream.c
+++ b/src/backends/meta-screen-cast-monitor-stream.c
@@ -105,12 +105,13 @@ meta_screen_cast_monitor_stream_get_monitor (MetaScreenCastMonitorStream *monito
 }
 
 MetaScreenCastMonitorStream *
-meta_screen_cast_monitor_stream_new (GDBusConnection     *connection,
-                                     MetaMonitorManager  *monitor_manager,
-                                     MetaMonitor         *monitor,
-                                     ClutterStage        *stage,
-                                     GError             **error)
+meta_screen_cast_monitor_stream_new (GDBusConnection  *connection,
+                                     MetaMonitor      *monitor,
+                                     ClutterStage     *stage,
+                                     GError          **error)
 {
+  MetaGpu *gpu = meta_monitor_get_gpu (monitor);
+  MetaMonitorManager *monitor_manager = meta_gpu_get_monitor_manager (gpu);
   MetaScreenCastMonitorStream *monitor_stream;
 
   if (!meta_monitor_is_active (monitor))
diff --git a/src/backends/meta-screen-cast-monitor-stream.h b/src/backends/meta-screen-cast-monitor-stream.h
index fbf3c77c3..1d24de93a 100644
--- a/src/backends/meta-screen-cast-monitor-stream.h
+++ b/src/backends/meta-screen-cast-monitor-stream.h
@@ -34,11 +34,10 @@ G_DECLARE_FINAL_TYPE (MetaScreenCastMonitorStream,
                       META, SCREEN_CAST_MONITOR_STREAM,
                       MetaScreenCastStream)
 
-MetaScreenCastMonitorStream * meta_screen_cast_monitor_stream_new (GDBusConnection    *connection,
-                                                                  MetaMonitorManager *monitor_manager,
-                                                                   MetaMonitor        *monitor,
-                                                                   ClutterStage       *stage,
-                                                                   GError            **error);
+MetaScreenCastMonitorStream * meta_screen_cast_monitor_stream_new (GDBusConnection  *connection,
+                                                                   MetaMonitor      *monitor,
+                                                                   ClutterStage     *stage,
+                                                                   GError          **error);
 
 ClutterStage * meta_screen_cast_monitor_stream_get_stage (MetaScreenCastMonitorStream *monitor_stream);
 
diff --git a/src/backends/meta-screen-cast-session.c b/src/backends/meta-screen-cast-session.c
index d0f5a79d9..3ba59037f 100644
--- a/src/backends/meta-screen-cast-session.c
+++ b/src/backends/meta-screen-cast-session.c
@@ -301,7 +301,6 @@ handle_record_monitor (MetaDBusScreenCastSession *skeleton,
   stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
 
   monitor_stream = meta_screen_cast_monitor_stream_new (connection,
-                                                        monitor_manager,
                                                         monitor,
                                                         stage,
                                                         &error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]