[gnome-flashback] screensaver: pass GfMonitorManager to GfManager



commit f6281165194af5c07dd4fbf7d783b1359f0a0e75
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sat Mar 20 13:16:39 2021 +0200

    screensaver: pass GfMonitorManager to GfManager

 gnome-flashback/gf-application.c                |  3 ++
 gnome-flashback/libscreensaver/Makefile.am      |  2 +
 gnome-flashback/libscreensaver/gf-manager.c     | 45 ++++++++++++++---------
 gnome-flashback/libscreensaver/gf-manager.h     | 49 +++++++++++++------------
 gnome-flashback/libscreensaver/gf-screensaver.c |  7 ++++
 gnome-flashback/libscreensaver/gf-screensaver.h | 13 ++++---
 6 files changed, 73 insertions(+), 46 deletions(-)
---
diff --git a/gnome-flashback/gf-application.c b/gnome-flashback/gf-application.c
index aff72ab..66231cb 100644
--- a/gnome-flashback/gf-application.c
+++ b/gnome-flashback/gf-application.c
@@ -234,6 +234,9 @@ settings_changed (GSettings   *settings,
 
   if (application->screensaver)
     {
+      gf_screensaver_set_monitor_manager (application->screensaver,
+                                          monitor_manager);
+
       gf_screensaver_set_input_sources (application->screensaver,
                                         application->input_sources);
     }
diff --git a/gnome-flashback/libscreensaver/Makefile.am b/gnome-flashback/libscreensaver/Makefile.am
index 238b595..8d11848 100644
--- a/gnome-flashback/libscreensaver/Makefile.am
+++ b/gnome-flashback/libscreensaver/Makefile.am
@@ -8,6 +8,7 @@ libscreensaver_la_CPPFLAGS = \
        -DG_LOG_DOMAIN=\"screensaver\" \
        -DG_LOG_USE_STRUCTURED=1 \
        -DGNOME_DESKTOP_USE_UNSTABLE_API \
+       -I$(top_builddir)/backends \
        -I$(top_builddir)/gnome-flashback/libinput-sources \
        -I$(top_builddir)/gnome-flashback/libscreensaver \
        -I$(top_srcdir) \
@@ -60,6 +61,7 @@ libscreensaver_la_LDFLAGS = \
 
 libscreensaver_la_LIBADD = \
        $(top_builddir)/dbus/libdbus.la \
+       $(top_builddir)/backends/libbackends.la \
        $(top_builddir)/gnome-flashback/libinput-sources/libinput-sources.la \
        $(SCREENSAVER_LIBS) \
        $(NULL)
diff --git a/gnome-flashback/libscreensaver/gf-manager.c b/gnome-flashback/libscreensaver/gf-manager.c
index e512e70..aea00cd 100644
--- a/gnome-flashback/libscreensaver/gf-manager.c
+++ b/gnome-flashback/libscreensaver/gf-manager.c
@@ -29,37 +29,39 @@
 
 struct _GfManager
 {
-  GObject         parent;
+  GObject           parent;
 
-  GSettings      *settings;
-  GnomeBG        *bg;
+  GSettings        *settings;
+  GnomeBG          *bg;
 
-  GfGrab         *grab;
-  GfFade         *fade;
+  GfGrab           *grab;
+  GfFade           *fade;
 
-  GfInputSources *input_sources;
+  GfMonitorManager *monitor_manager;
 
-  GSList         *windows;
+  GfInputSources   *input_sources;
 
-  gboolean        active;
+  GSList           *windows;
 
-  gboolean        lock_active;
+  gboolean          active;
 
-  gboolean        lock_enabled;
+  gboolean          lock_active;
 
-  glong           lock_timeout;
+  gboolean          lock_enabled;
 
-  gboolean        user_switch_enabled;
+  glong             lock_timeout;
 
-  time_t          activate_time;
+  gboolean          user_switch_enabled;
 
-  guint           lock_timeout_id;
-  guint           unfade_timeout_id;
+  time_t            activate_time;
 
-  gboolean        dialog_up;
+  guint             lock_timeout_id;
+  guint             unfade_timeout_id;
 
-  gulong          monitor_added_id;
-  gulong          monitor_removed_id;
+  gboolean          dialog_up;
+
+  gulong            monitor_added_id;
+  gulong            monitor_removed_id;
 };
 
 enum
@@ -709,6 +711,13 @@ gf_manager_new (GfGrab *grab,
                        NULL);
 }
 
+void
+gf_manager_set_monitor_manager (GfManager        *self,
+                                GfMonitorManager *monitor_manager)
+{
+  self->monitor_manager = monitor_manager;
+}
+
 void
 gf_manager_set_input_sources (GfManager      *self,
                               GfInputSources *input_sources)
diff --git a/gnome-flashback/libscreensaver/gf-manager.h b/gnome-flashback/libscreensaver/gf-manager.h
index 487649e..e81f178 100644
--- a/gnome-flashback/libscreensaver/gf-manager.h
+++ b/gnome-flashback/libscreensaver/gf-manager.h
@@ -23,7 +23,8 @@
 #ifndef GF_MANAGER_H
 #define GF_MANAGER_H
 
-#include <libinput-sources/gf-input-sources.h>
+#include "backends/gf-monitor-manager.h"
+#include "libinput-sources/gf-input-sources.h"
 
 #include "gf-fade.h"
 #include "gf-grab.h"
@@ -33,40 +34,42 @@ G_BEGIN_DECLS
 #define GF_TYPE_MANAGER (gf_manager_get_type ())
 G_DECLARE_FINAL_TYPE (GfManager, gf_manager, GF, MANAGER, GObject)
 
-GfManager *gf_manager_new                     (GfGrab         *grab,
-                                               GfFade         *fade);
+GfManager *gf_manager_new                     (GfGrab           *grab,
+                                               GfFade           *fade);
 
-void       gf_manager_set_input_sources       (GfManager      *self,
-                                               GfInputSources *input_sources);
+void       gf_manager_set_monitor_manager     (GfManager        *self,
+                                               GfMonitorManager *monitor_manager);
 
-gboolean   gf_manager_set_active              (GfManager      *self,
-                                               gboolean        active);
+void       gf_manager_set_input_sources       (GfManager        *self,
+                                               GfInputSources   *input_sources);
 
-gboolean   gf_manager_get_active              (GfManager      *self);
+gboolean   gf_manager_set_active              (GfManager        *self,
+                                               gboolean          active);
 
-gboolean   gf_manager_get_lock_active         (GfManager      *self);
+gboolean   gf_manager_get_active              (GfManager        *self);
 
-void       gf_manager_set_lock_active         (GfManager      *self,
-                                               gboolean        lock_active);
+gboolean   gf_manager_get_lock_active         (GfManager        *self);
 
-gboolean   gf_manager_get_lock_enabled        (GfManager      *self);
+void       gf_manager_set_lock_active         (GfManager        *self,
+                                               gboolean          lock_active);
 
-void       gf_manager_set_lock_enabled        (GfManager      *self,
-                                               gboolean        lock_enabled);
+gboolean   gf_manager_get_lock_enabled        (GfManager        *self);
 
-void       gf_manager_set_lock_timeout        (GfManager      *self,
-                                               glong           lock_timeout);
+void       gf_manager_set_lock_enabled        (GfManager        *self,
+                                               gboolean          lock_enabled);
 
+void       gf_manager_set_lock_timeout        (GfManager        *self,
+                                               glong             lock_timeout);
 
-void       gf_manager_set_user_switch_enabled (GfManager      *self,
-                                               gboolean        user_switch_enabled);
+void       gf_manager_set_user_switch_enabled (GfManager        *self,
+                                               gboolean          user_switch_enabled);
 
-void       gf_manager_show_message            (GfManager      *self,
-                                               const char     *summary,
-                                               const char     *body,
-                                               const char     *icon);
+void       gf_manager_show_message            (GfManager        *self,
+                                               const char       *summary,
+                                               const char       *body,
+                                               const char       *icon);
 
-void       gf_manager_request_unlock          (GfManager      *self);
+void       gf_manager_request_unlock          (GfManager        *self);
 
 G_END_DECLS
 
diff --git a/gnome-flashback/libscreensaver/gf-screensaver.c b/gnome-flashback/libscreensaver/gf-screensaver.c
index f97eb59..5cad9d9 100644
--- a/gnome-flashback/libscreensaver/gf-screensaver.c
+++ b/gnome-flashback/libscreensaver/gf-screensaver.c
@@ -375,6 +375,13 @@ gf_screensaver_new (void)
   return g_object_new (GF_TYPE_SCREENSAVER, NULL);
 }
 
+void
+gf_screensaver_set_monitor_manager (GfScreensaver    *self,
+                                    GfMonitorManager *monitor_manager)
+{
+  gf_manager_set_monitor_manager (self->manager, monitor_manager);
+}
+
 void
 gf_screensaver_set_input_sources (GfScreensaver  *self,
                                   GfInputSources *input_sources)
diff --git a/gnome-flashback/libscreensaver/gf-screensaver.h b/gnome-flashback/libscreensaver/gf-screensaver.h
index b7303e4..bab6d81 100644
--- a/gnome-flashback/libscreensaver/gf-screensaver.h
+++ b/gnome-flashback/libscreensaver/gf-screensaver.h
@@ -18,18 +18,21 @@
 #ifndef GF_SCREENSAVER_H
 #define GF_SCREENSAVER_H
 
-#include <glib-object.h>
-#include <libinput-sources/gf-input-sources.h>
+#include "backends/gf-monitor-manager.h"
+#include "libinput-sources/gf-input-sources.h"
 
 G_BEGIN_DECLS
 
 #define GF_TYPE_SCREENSAVER gf_screensaver_get_type ()
 G_DECLARE_FINAL_TYPE (GfScreensaver, gf_screensaver, GF, SCREENSAVER, GObject)
 
-GfScreensaver *gf_screensaver_new               (void);
+GfScreensaver *gf_screensaver_new                 (void);
 
-void           gf_screensaver_set_input_sources (GfScreensaver  *self,
-                                                 GfInputSources *input_sources);
+void           gf_screensaver_set_monitor_manager (GfScreensaver    *self,
+                                                   GfMonitorManager *monitor_manager);
+
+void           gf_screensaver_set_input_sources   (GfScreensaver    *self,
+                                                   GfInputSources   *input_sources);
 
 G_END_DECLS
 


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