summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applets/notification_area/na-tray.c4
-rw-r--r--applets/notification_area/testtray.c11
-rw-r--r--mate-panel/panel-background-monitor.c17
-rw-r--r--mate-panel/panel-multiscreen.c14
4 files changed, 45 insertions, 1 deletions
diff --git a/applets/notification_area/na-tray.c b/applets/notification_area/na-tray.c
index c1b24da8..0232983b 100644
--- a/applets/notification_area/na-tray.c
+++ b/applets/notification_area/na-tray.c
@@ -646,12 +646,16 @@ na_tray_constructor (GType type,
if (!initialized)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ trays_screens = g_new0 (TraysScreen, 1);
+#else
GdkDisplay *display;
int n_screens;
display = gdk_display_get_default ();
n_screens = gdk_display_get_n_screens (display);
trays_screens = g_new0 (TraysScreen, n_screens);
+#endif
initialized = TRUE;
}
diff --git a/applets/notification_area/testtray.c b/applets/notification_area/testtray.c
index 74cde0e7..c541aaa2 100644
--- a/applets/notification_area/testtray.c
+++ b/applets/notification_area/testtray.c
@@ -215,19 +215,28 @@ main (int argc, char *argv[])
{
GdkDisplay *display;
GdkScreen *screen;
+#if !GTK_CHECK_VERSION (3, 0, 0)
int n_screens, i;
+#endif
gtk_init (&argc, &argv);
gtk_window_set_default_icon_name (NOTIFICATION_AREA_ICON);
display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ screen = gdk_display_get_default_screen (display);
+
+ create_tray_on_screen (screen, FALSE);
+#else
n_screens = gdk_display_get_n_screens (display);
for (i = 0; i < n_screens; ++i) {
screen = gdk_display_get_screen (display, i);
-
create_tray_on_screen (screen, FALSE);
+
+ create_tray_on_screen (screen, FALSE);
}
+#endif
gtk_main ();
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
diff --git a/mate-panel/panel-multiscreen.c b/mate-panel/panel-multiscreen.c
index 7142b02a..10935b4e 100644
--- a/mate-panel/panel-multiscreen.c
+++ b/mate-panel/panel-multiscreen.c
@@ -417,7 +417,11 @@ panel_multiscreen_init (void)
return;
display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ screens = 1;
+#else
screens = gdk_display_get_n_screens (display);
+#endif
panel_multiscreen_init_randr (display);
@@ -449,10 +453,15 @@ panel_multiscreen_init (void)
void
panel_multiscreen_reinit (void)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkScreen *screen;
+ GList *toplevels, *l;
+#else
GdkDisplay *display;
GList *toplevels, *l;
int new_screens;
int i;
+#endif
if (monitors)
g_free (monitors);
@@ -465,6 +474,10 @@ panel_multiscreen_reinit (void)
g_free (geometries);
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+ screen = gdk_screen_get_default ();
+ g_signal_handlers_disconnect_by_func (screen, panel_multiscreen_queue_reinit, NULL);
+#else
display = gdk_display_get_default ();
/* Don't use the screens variable since in the future, we might
* want to call this function when a screen appears/disappears. */
@@ -478,6 +491,7 @@ panel_multiscreen_reinit (void)
panel_multiscreen_queue_reinit,
NULL);
}
+#endif
initialized = FALSE;
panel_multiscreen_init ();