[mutter/gnome-3-14] meta-background: Add a function to refresh all background instances
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gnome-3-14] meta-background: Add a function to refresh all background instances
- Date: Mon, 23 Mar 2015 17:38:16 +0000 (UTC)
commit 6b3be51ca862b7c878a03c7ee730f3e3abaa2daa
Author: Rui Matos <tiagomatos gmail com>
Date: Thu Mar 19 14:58:25 2015 +0100
meta-background: Add a function to refresh all background instances
We need to reload the FBOs under some circumstances, this adds a way
to easily do so.
https://bugzilla.gnome.org/show_bug.cgi?id=739178
src/compositor/meta-background.c | 14 ++++++++++++++
src/meta/meta-background.h | 2 ++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index 0370f55..75fbc28 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -71,6 +71,8 @@ enum
G_DEFINE_TYPE (MetaBackground, meta_background, G_TYPE_OBJECT)
+static GSList *all_backgrounds = NULL;
+
static void
free_fbos (MetaBackground *self)
{
@@ -291,6 +293,8 @@ meta_background_dispose (GObject *object)
static void
meta_background_finalize (GObject *object)
{
+ all_backgrounds = g_slist_remove (all_backgrounds, object);
+
G_OBJECT_CLASS (meta_background_parent_class)->finalize (object);
}
@@ -333,6 +337,7 @@ meta_background_init (MetaBackground *self)
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
META_TYPE_BACKGROUND,
MetaBackgroundPrivate);
+ all_backgrounds = g_slist_prepend (all_backgrounds, self);
}
static void
@@ -899,3 +904,12 @@ meta_background_set_blend (MetaBackground *self,
free_wallpaper_texture (self);
mark_changed (self);
}
+
+void
+meta_background_refresh_all (void)
+{
+ GSList *l;
+
+ for (l = all_backgrounds; l; l = l->next)
+ mark_changed (l->data);
+}
diff --git a/src/meta/meta-background.h b/src/meta/meta-background.h
index 38706dc..aa7c707 100644
--- a/src/meta/meta-background.h
+++ b/src/meta/meta-background.h
@@ -57,6 +57,8 @@ struct _MetaBackground
MetaBackgroundPrivate *priv;
};
+void meta_background_refresh_all (void);
+
GType meta_background_get_type (void);
MetaBackground *meta_background_new (MetaScreen *screen);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]