summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-02-11 15:41:16 +0300
committerWolfgang Ulbrich <[email protected]>2016-02-12 07:04:32 +0100
commitaeeed190c86aae741de41feb08ccd80427196224 (patch)
tree53da1fd1ef9b5736151e5fed0da2fe6a03bb5f43
parent1b7d949fd82fa646d9705b7a04e7090d4f5b9366 (diff)
downloadmate-panel-aeeed190c86aae741de41feb08ccd80427196224.tar.bz2
mate-panel-aeeed190c86aae741de41feb08ccd80427196224.tar.xz
[GTK+3] fix one more use of deprecated gdk_display_get_n_screens
-rw-r--r--mate-panel/panel-profile.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c
index e8707e45..cadab6f0 100644
--- a/mate-panel/panel-profile.c
+++ b/mate-panel/panel-profile.c
@@ -1151,7 +1151,11 @@ get_toplevel_screen (char *toplevel_path)
display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (screen_n < 0) {
+#else
if (screen_n < 0 || screen_n >= gdk_display_get_n_screens (display)) {
+#endif
#if 0
g_warning (_("Panel '%s' is set to be displayed on screen %d which "
"is not currently available. Not loading this panel."),
@@ -1691,16 +1695,27 @@ panel_profile_ensure_toplevel_per_screen ()
GSList *empty_screens = NULL;
GSList *l;
GdkDisplay *display;
+ GdkScreen *screen;
+#if !GTK_CHECK_VERSION (3, 0, 0)
int n_screens, i;
+#endif
toplevels = panel_toplevel_list_toplevels ();
display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 0, 0)
+ screen = gdk_display_get_default_screen (display);
+
+ for (l = toplevels; l; l = l->next)
+ if (gtk_window_get_screen (l->data) == screen)
+ break;
+
+ if (!l)
+ empty_screens = g_slist_prepend (empty_screens, screen);
+#else
n_screens = gdk_display_get_n_screens (display);
for (i = 0; i < n_screens; i++) {
- GdkScreen *screen;
-
screen = gdk_display_get_screen (display, i);
for (l = toplevels; l; l = l->next)
@@ -1710,6 +1725,7 @@ panel_profile_ensure_toplevel_per_screen ()
if (!l)
empty_screens = g_slist_prepend (empty_screens, screen);
}
+#endif
for (l = empty_screens; l; l = l->next)
panel_layout_apply_default_from_gkeyfile (l->data);