[gnome-panel/wip/gnome-3.10+: 47/75] panel-background-monitor: fix deprecated warning
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/gnome-3.10+: 47/75] panel-background-monitor: fix deprecated warning
- Date: Tue, 7 Oct 2014 22:29:57 +0000 (UTC)
commit 25f0d7d57f16fcfff39f9c94d16d7a72792e1840
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Jul 10 17:51:21 2014 +0300
panel-background-monitor: fix deprecated warning
gnome-panel/panel-background-monitor.c | 28 +++++++---------------------
1 files changed, 7 insertions(+), 21 deletions(-)
---
diff --git a/gnome-panel/panel-background-monitor.c b/gnome-panel/panel-background-monitor.c
index 455c7b3..0c16a5a 100644
--- a/gnome-panel/panel-background-monitor.c
+++ b/gnome-panel/panel-background-monitor.c
@@ -73,7 +73,7 @@ struct _PanelBackgroundMonitor {
G_DEFINE_TYPE (PanelBackgroundMonitor, panel_background_monitor, G_TYPE_OBJECT)
-static PanelBackgroundMonitor **global_background_monitors = NULL;
+static PanelBackgroundMonitor *global_background_monitor = NULL;
static guint signals [LAST_SIGNAL] = { 0 };
@@ -174,30 +174,16 @@ panel_background_monitor_new (GdkScreen *screen)
PanelBackgroundMonitor *
panel_background_monitor_get_for_screen (GdkScreen *screen)
{
- int screen_number;
+ if (!global_background_monitor) {
+ global_background_monitor = panel_background_monitor_new (screen);
- screen_number = gdk_screen_get_number (screen);
+ g_object_add_weak_pointer (G_OBJECT (global_background_monitor),
+ (void **) &global_background_monitor);
- if (!global_background_monitors) {
- int n_screens;
-
- n_screens = gdk_display_get_n_screens (gdk_display_get_default ());
-
- global_background_monitors = g_new0 (PanelBackgroundMonitor *, n_screens);
- }
-
- if (!global_background_monitors [screen_number]) {
- global_background_monitors [screen_number] =
- panel_background_monitor_new (screen);
-
- g_object_add_weak_pointer (
- G_OBJECT (global_background_monitors [screen_number]),
- (void **) &global_background_monitors [screen_number]);
-
- return global_background_monitors [screen_number];
+ return global_background_monitor;
}
- return g_object_ref (global_background_monitors [screen_number]);
+ return g_object_ref (global_background_monitor);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]