From 261b2a3220d803b96f41e61ba94b8c040955259c Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Thu, 2 Feb 2017 19:07:06 +0300 Subject: Revert "GTK 3.21: Fix caja startup background" and revert "GTK 3.21: Fix background changing, startup delay". These are no longer of need as Caja reclaimed its ability to draw backgrounds. --- plugins/background/msd-background-manager.c | 41 ++++++----------------------- 1 file changed, 8 insertions(+), 33 deletions(-) (limited to 'plugins') diff --git a/plugins/background/msd-background-manager.c b/plugins/background/msd-background-manager.c index d693312..586589b 100644 --- a/plugins/background/msd-background-manager.c +++ b/plugins/background/msd-background-manager.c @@ -67,9 +67,7 @@ struct MsdBackgroundManagerPrivate { GList *scr_sizes; gboolean msd_can_draw; -#if !GTK_CHECK_VERSION(3, 21, 0) gboolean caja_can_draw; -#endif gboolean do_fade; gboolean draw_in_progress; @@ -97,7 +95,6 @@ can_fade_bg (MsdBackgroundManager *manager) return g_settings_get_boolean (manager->priv->settings, MATE_BG_KEY_BACKGROUND_FADE); } -#if !GTK_CHECK_VERSION(3, 21, 0) /* Whether Caja is configured to draw desktop (show-desktop-icons) */ static gboolean caja_can_draw_bg (MsdBackgroundManager *manager) @@ -161,7 +158,7 @@ caja_is_drawing_bg (MsdBackgroundManager *manager) return running; } -#endif + static void free_fade (MsdBackgroundManager *manager) { @@ -221,13 +218,9 @@ draw_background (MsdBackgroundManager *manager, { MsdBackgroundManagerPrivate *p = manager->priv; -#if GTK_CHECK_VERSION(3, 21, 0) - if (!p->msd_can_draw || p->draw_in_progress) - return; -#else if (!p->msd_can_draw || p->draw_in_progress || caja_is_drawing_bg (manager)) return; -#endif + mate_settings_profile_start (NULL); GdkDisplay *display = gdk_display_get_default (); @@ -270,13 +263,10 @@ on_screen_size_changed (GdkScreen *screen, MsdBackgroundManager *manager) { MsdBackgroundManagerPrivate *p = manager->priv; -#if GTK_CHECK_VERSION(3, 21, 0) - if (!p->msd_can_draw || p->draw_in_progress) - return; -#else + if (!p->msd_can_draw || p->draw_in_progress || caja_is_drawing_bg (manager)) return; -#endif + gint scr_num = gdk_screen_get_number (screen); gchar *old_size = g_list_nth_data (manager->priv->scr_sizes, scr_num); gchar *new_size = g_strdup_printf ("%dx%d", gdk_screen_get_width (screen), @@ -347,20 +337,14 @@ settings_change_event_cb (GSettings *settings, /* Complements on_bg_handling_changed() */ p->msd_can_draw = msd_can_draw_bg (manager); -#if GTK_CHECK_VERSION(3, 21, 0) - if (p->msd_can_draw && p->bg != NULL) - { - /* Defer signal processing to avoid making the dconf backend deadlock */ - g_idle_add ((GSourceFunc) settings_change_event_idle_cb, manager); - } -#else p->caja_can_draw = caja_can_draw_bg (manager); + if (p->msd_can_draw && p->bg != NULL && !caja_is_drawing_bg (manager)) { /* Defer signal processing to avoid making the dconf backend deadlock */ g_idle_add ((GSourceFunc) settings_change_event_idle_cb, manager); } -#endif + return FALSE; /* let the event propagate further */ } @@ -418,7 +402,7 @@ on_bg_handling_changed (GSettings *settings, MsdBackgroundManagerPrivate *p = manager->priv; mate_settings_profile_start (NULL); -#if !GTK_CHECK_VERSION(3, 21, 0) + if (caja_is_drawing_bg (manager)) { if (p->bg != NULL) @@ -426,11 +410,9 @@ on_bg_handling_changed (GSettings *settings, } else if (p->msd_can_draw && p->bg == NULL) { -#endif setup_background (manager); -#if !GTK_CHECK_VERSION(3, 21, 0) } -#endif + mate_settings_profile_end (NULL); } @@ -526,9 +508,7 @@ msd_background_manager_start (MsdBackgroundManager *manager, p->settings = g_settings_new (MATE_BG_SCHEMA); p->msd_can_draw = msd_can_draw_bg (manager); -#if !GTK_CHECK_VERSION(3, 21, 0) p->caja_can_draw = caja_can_draw_bg (manager); -#endif g_signal_connect (p->settings, "changed::" MATE_BG_KEY_DRAW_BACKGROUND, G_CALLBACK (on_bg_handling_changed), manager); @@ -541,19 +521,14 @@ msd_background_manager_start (MsdBackgroundManager *manager, */ if (p->msd_can_draw) { -#if !GTK_CHECK_VERSION(3, 21, 0) if (p->caja_can_draw) { - draw_bg_after_session_loads (manager); } else { -#endif setup_background (manager); -#if !GTK_CHECK_VERSION(3, 21, 0) } -#endif } mate_settings_profile_end (NULL); -- cgit v1.2.1