summaryrefslogtreecommitdiff
path: root/applets/notification_area
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-02-11 07:31:27 +0100
committerWolfgang Ulbrich <[email protected]>2016-02-12 07:04:30 +0100
commita14d2b7ddde3bc2713b31e692331f74f0b5ceb68 (patch)
treec24e382ba8df420c1a9c6da42b5d8e459302fe5f /applets/notification_area
parent217ce17fff3e4eb3670a03c3d48771a03bf3f9d9 (diff)
downloadmate-panel-a14d2b7ddde3bc2713b31e692331f74f0b5ceb68.tar.bz2
mate-panel-a14d2b7ddde3bc2713b31e692331f74f0b5ceb68.tar.xz
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
Diffstat (limited to 'applets/notification_area')
-rw-r--r--applets/notification_area/na-tray.c4
-rw-r--r--applets/notification_area/testtray.c11
2 files changed, 14 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 ();