From daa0acc2088b8501c3c55134f8f21f3e853ca83d Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Tue, 1 Aug 2017 02:40:51 +0200 Subject: avoid deprecated gdk_display_get_screen and gdk_display_get_n_screens --- plugins/xsettings/msd-xsettings-manager.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'plugins/xsettings') 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; -- cgit v1.2.1