summaryrefslogtreecommitdiff
path: root/plugins/xsettings
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-01 02:40:51 +0200
committerraveit65 <[email protected]>2017-08-09 22:07:03 +0200
commitdaa0acc2088b8501c3c55134f8f21f3e853ca83d (patch)
treea2ee25376922bafd9614e4f58bb56f01a77b995b /plugins/xsettings
parent9568139c78f5d5621f87faee2db423fd9e1aa619 (diff)
downloadmate-settings-daemon-daa0acc2088b8501c3c55134f8f21f3e853ca83d.tar.bz2
mate-settings-daemon-daa0acc2088b8501c3c55134f8f21f3e853ca83d.tar.xz
avoid deprecated gdk_display_get_screen and gdk_display_get_n_screens
Diffstat (limited to 'plugins/xsettings')
-rw-r--r--plugins/xsettings/msd-xsettings-manager.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/plugins/xsettings/msd-xsettings-manager.c b/plugins/xsettings/msd-xsettings-manager.c
index b88e71f..e7849ec 100644
--- a/plugins/xsettings/msd-xsettings-manager.c
+++ b/plugins/xsettings/msd-xsettings-manager.c
@@ -643,13 +643,10 @@ static gboolean
setup_xsettings_managers (MateXSettingsManager *manager)
{
GdkDisplay *display;
- int i;
- int n_screens;
gboolean res;
gboolean terminated;
display = gdk_display_get_default ();
- n_screens = gdk_display_get_n_screens (display);
res = xsettings_manager_check_running (gdk_x11_display_get_xdisplay (display),
gdk_x11_screen_get_screen_number (gdk_screen_get_default ()));
@@ -658,22 +655,21 @@ setup_xsettings_managers (MateXSettingsManager *manager)
return FALSE;
}
- manager->priv->managers = g_new0 (XSettingsManager *, n_screens + 1);
+ manager->priv->managers = g_new0 (XSettingsManager *, 2);
terminated = FALSE;
- for (i = 0; i < n_screens; i++) {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
-
- manager->priv->managers [i] = xsettings_manager_new (gdk_x11_display_get_xdisplay (display),
- gdk_x11_screen_get_screen_number (screen),
- terminate_cb,
- &terminated);
- if (! manager->priv->managers [i]) {
- g_warning ("Could not create xsettings manager for screen %d!", i);
- return FALSE;
- }
+
+ GdkScreen *screen;
+
+ screen = gdk_display_get_default_screen (display);
+
+ manager->priv->managers [0] = xsettings_manager_new (gdk_x11_display_get_xdisplay (display),
+ gdk_x11_screen_get_screen_number (screen),
+ terminate_cb,
+ &terminated);
+ if (! manager->priv->managers [0]) {
+ g_warning ("Could not create xsettings manager for screen!");
+ return FALSE;
}
return TRUE;