[gnome-flashback] desktop: pass GfMonitorManager to GfDesktopWindow
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] desktop: pass GfMonitorManager to GfDesktopWindow
- Date: Sat, 20 Mar 2021 17:09:32 +0000 (UTC)
commit 3035f2781795849089751283a29a43ce13d759d0
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Mar 20 13:30:28 2021 +0200
desktop: pass GfMonitorManager to GfDesktopWindow
gnome-flashback/gf-application.c | 3 +++
gnome-flashback/libdesktop/Makefile.am | 2 ++
gnome-flashback/libdesktop/gf-desktop-window.c | 33 ++++++++++++++++----------
gnome-flashback/libdesktop/gf-desktop-window.h | 16 ++++++++-----
gnome-flashback/libdesktop/gf-desktop.c | 11 +++++++++
gnome-flashback/libdesktop/gf-desktop.h | 7 ++++--
6 files changed, 52 insertions(+), 20 deletions(-)
---
diff --git a/gnome-flashback/gf-application.c b/gnome-flashback/gf-application.c
index 66231cb..5769e50 100644
--- a/gnome-flashback/gf-application.c
+++ b/gnome-flashback/gf-application.c
@@ -228,6 +228,9 @@ settings_changed (GSettings *settings,
#undef SETTING_CHANGED
+ if (application->desktop)
+ gf_desktop_set_monitor_manager (application->desktop, monitor_manager);
+
if (application->input_settings)
gf_input_settings_set_monitor_manager (application->input_settings,
monitor_manager);
diff --git a/gnome-flashback/libdesktop/Makefile.am b/gnome-flashback/libdesktop/Makefile.am
index 1c7a695..a8fc5f7 100644
--- a/gnome-flashback/libdesktop/Makefile.am
+++ b/gnome-flashback/libdesktop/Makefile.am
@@ -8,6 +8,7 @@ libdesktop_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\"desktop\" \
-DG_LOG_USE_STRUCTURED=1 \
-DGNOME_DESKTOP_USE_UNSTABLE_API \
+ -I$(top_builddir)/backends \
-I$(top_builddir)/gnome-flashback/libcommon \
-I$(top_builddir)/gnome-flashback/libdesktop \
-I$(top_srcdir)/gnome-flashback \
@@ -60,6 +61,7 @@ libdesktop_la_LDFLAGS = \
libdesktop_la_LIBADD = \
$(top_builddir)/dbus/libdbus.la \
+ $(top_builddir)/backends/libbackends.la \
$(top_builddir)/gnome-flashback/libcommon/libcommon.la \
$(DESKTOP_LIBS) \
$(NULL)
diff --git a/gnome-flashback/libdesktop/gf-desktop-window.c b/gnome-flashback/libdesktop/gf-desktop-window.c
index 3ea99f1..ed6dd34 100644
--- a/gnome-flashback/libdesktop/gf-desktop-window.c
+++ b/gnome-flashback/libdesktop/gf-desktop-window.c
@@ -29,24 +29,26 @@
struct _GfDesktopWindow
{
- GtkWindow parent;
+ GtkWindow parent;
- gboolean draw_background;
- GfBackground *background;
- gboolean event_filter_added;
- cairo_surface_t *surface;
+ GfMonitorManager *monitor_manager;
- gboolean show_icons;
- GtkWidget *icon_view;
+ gboolean draw_background;
+ GfBackground *background;
+ gboolean event_filter_added;
+ cairo_surface_t *surface;
- int width;
- int height;
+ gboolean show_icons;
+ GtkWidget *icon_view;
- guint move_resize_id;
+ int width;
+ int height;
- gboolean ready;
+ guint move_resize_id;
- GdkRGBA *representative_color;
+ gboolean ready;
+
+ GdkRGBA *representative_color;
};
enum
@@ -832,6 +834,13 @@ gf_desktop_window_new (gboolean draw_background,
return window;
}
+void
+gf_desktop_window_set_monitor_manager (GfDesktopWindow *self,
+ GfMonitorManager *monitor_manager)
+{
+ self->monitor_manager = monitor_manager;
+}
+
gboolean
gf_desktop_window_is_ready (GfDesktopWindow *self)
{
diff --git a/gnome-flashback/libdesktop/gf-desktop-window.h b/gnome-flashback/libdesktop/gf-desktop-window.h
index 56e9e1f..8503dab 100644
--- a/gnome-flashback/libdesktop/gf-desktop-window.h
+++ b/gnome-flashback/libdesktop/gf-desktop-window.h
@@ -18,6 +18,7 @@
#ifndef GF_DESKTOP_WINDOW_H
#define GF_DESKTOP_WINDOW_H
+#include "backends/gf-monitor-manager.h"
#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -26,15 +27,18 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GfDesktopWindow, gf_desktop_window,
GF, DESKTOP_WINDOW, GtkWindow)
-GtkWidget *gf_desktop_window_new (gboolean draw_background,
- gboolean show_icons,
- GError **error);
+GtkWidget *gf_desktop_window_new (gboolean draw_background,
+ gboolean show_icons,
+ GError **error);
-gboolean gf_desktop_window_is_ready (GfDesktopWindow *self);
+void gf_desktop_window_set_monitor_manager (GfDesktopWindow *self,
+ GfMonitorManager *monitor_manager);
-int gf_desktop_window_get_width (GfDesktopWindow *self);
+gboolean gf_desktop_window_is_ready (GfDesktopWindow *self);
-int gf_desktop_window_get_height (GfDesktopWindow *self);
+int gf_desktop_window_get_width (GfDesktopWindow *self);
+
+int gf_desktop_window_get_height (GfDesktopWindow *self);
G_END_DECLS
diff --git a/gnome-flashback/libdesktop/gf-desktop.c b/gnome-flashback/libdesktop/gf-desktop.c
index 6a582ba..efcdcc3 100644
--- a/gnome-flashback/libdesktop/gf-desktop.c
+++ b/gnome-flashback/libdesktop/gf-desktop.c
@@ -105,3 +105,14 @@ gf_desktop_new (void)
{
return g_object_new (GF_TYPE_DESKTOP, NULL);
}
+
+void
+gf_desktop_set_monitor_manager (GfDesktop *self,
+ GfMonitorManager *monitor_manager)
+{
+ if (self->window == NULL)
+ return;
+
+ gf_desktop_window_set_monitor_manager (GF_DESKTOP_WINDOW (self->window),
+ monitor_manager);
+}
diff --git a/gnome-flashback/libdesktop/gf-desktop.h b/gnome-flashback/libdesktop/gf-desktop.h
index 5f11e0b..2b40368 100644
--- a/gnome-flashback/libdesktop/gf-desktop.h
+++ b/gnome-flashback/libdesktop/gf-desktop.h
@@ -18,14 +18,17 @@
#ifndef GF_DESKTOP_H
#define GF_DESKTOP_H
-#include <glib-object.h>
+#include "backends/gf-monitor-manager.h"
G_BEGIN_DECLS
#define GF_TYPE_DESKTOP (gf_desktop_get_type ())
G_DECLARE_FINAL_TYPE (GfDesktop, gf_desktop, GF, DESKTOP, GObject)
-GfDesktop *gf_desktop_new (void);
+GfDesktop *gf_desktop_new (void);
+
+void gf_desktop_set_monitor_manager (GfDesktop *self,
+ GfMonitorManager *monitor_manager);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]