From a14d2b7ddde3bc2713b31e692331f74f0b5ceb68 Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Thu, 11 Feb 2016 07:31:27 +0100 Subject: GTK+3: do not use deprecated n_screens since gtk+-3.10 screen is always 1 taken from: https://git.gnome.org/browse/gnome-panel/commit/?id=be976a0 https://git.gnome.org/browse/gnome-panel/commit/?id=272f680 --- mate-panel/panel-background-monitor.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mate-panel/panel-background-monitor.c') diff --git a/mate-panel/panel-background-monitor.c b/mate-panel/panel-background-monitor.c index 2bd7fe15..a660ca1e 100644 --- a/mate-panel/panel-background-monitor.c +++ b/mate-panel/panel-background-monitor.c @@ -80,7 +80,11 @@ struct _PanelBackgroundMonitor { G_DEFINE_TYPE (PanelBackgroundMonitor, panel_background_monitor, G_TYPE_OBJECT) +#if GTK_CHECK_VERSION (3, 0, 0) +static PanelBackgroundMonitor *global_background_monitor = NULL; +#else static PanelBackgroundMonitor **global_background_monitors = NULL; +#endif static guint signals [LAST_SIGNAL] = { 0 }; @@ -198,6 +202,18 @@ panel_background_monitor_new (GdkScreen *screen) PanelBackgroundMonitor * panel_background_monitor_get_for_screen (GdkScreen *screen) { +#if GTK_CHECK_VERSION (3, 0, 0) + if (!global_background_monitor) { + global_background_monitor = panel_background_monitor_new (screen); + + g_object_add_weak_pointer (G_OBJECT (global_background_monitor), + (void **) &global_background_monitor); + + return global_background_monitor; + } + + return g_object_ref (global_background_monitor); +#else int screen_number; screen_number = gdk_screen_get_number (screen); @@ -222,6 +238,7 @@ panel_background_monitor_get_for_screen (GdkScreen *screen) } return g_object_ref (global_background_monitors [screen_number]); +#endif } static void -- cgit v1.2.1