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
commitdc1033310a53712ec4d778aee468f8e490018126 (patch)
tree03d7907d0d49ecbcd802ce2a6b7d233ac32ad144
parentaeeed190c86aae741de41feb08ccd80427196224 (diff)
downloadmate-panel-dc1033310a53712ec4d778aee468f8e490018126.tar.bz2
mate-panel-dc1033310a53712ec4d778aee468f8e490018126.tar.xz
[GTK+3] fix one more use of deprecated gdk_display_get_n_screens
-rw-r--r--mate-panel/panel-profile.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c
index cadab6f0..4646a617 100644
--- a/mate-panel/panel-profile.c
+++ b/mate-panel/panel-profile.c
@@ -1137,10 +1137,10 @@ panel_profile_delete_toplevel (PanelToplevel *toplevel)
panel_profile_remove_from_list (PANEL_GSETTINGS_TOPLEVELS, toplevel_id);
}
+#if !GTK_CHECK_VERSION (3, 0, 0)
static GdkScreen *
get_toplevel_screen (char *toplevel_path)
{
-
GdkDisplay *display;
GSettings *settings;
int screen_n;
@@ -1166,6 +1166,7 @@ get_toplevel_screen (char *toplevel_path)
return gdk_display_get_screen (display, screen_n);
}
+#endif
PanelToplevel *
panel_profile_load_toplevel (const char *toplevel_id)
@@ -1180,7 +1181,13 @@ panel_profile_load_toplevel (const char *toplevel_id)
toplevel_path = g_strdup_printf ("%s%s/", PANEL_TOPLEVEL_PATH, toplevel_id);
- if (!(screen = get_toplevel_screen (toplevel_path))) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ screen = gdk_display_get_default_screen (gdk_display_get_default ());
+#else
+ screen = get_toplevel_screen (toplevel_path);
+#endif
+
+ if (screen == NULL) {
g_free (toplevel_path);
return NULL;
}