[libadwaita/wip/exalm/animations: 8/8] style-manager: Properly reset animations




commit 156b55e0a3850ea7071393040ced397b35af0404
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Nov 29 02:50:15 2021 +0500

    style-manager: Properly reset animations
    
    Turns out we were permanently enabling animations after a light/dark
    transition. This shouldn't happen.

 src/adw-style-manager.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/adw-style-manager.c b/src/adw-style-manager.c
index e66d7d81..c642d3d4 100644
--- a/src/adw-style-manager.c
+++ b/src/adw-style-manager.c
@@ -123,9 +123,8 @@ register_display (GdkDisplayManager *display_manager,
 static gboolean
 enable_animations_cb (AdwStyleManager *self)
 {
-  g_object_set (gtk_settings_get_for_display (self->display),
-                "gtk-enable-animations", TRUE,
-                NULL);
+  gtk_settings_reset_property (gtk_settings_get_for_display (self->display),
+                               "gtk-enable-animations");
 
   self->animation_timeout_id = 0;
 
@@ -152,10 +151,12 @@ update_stylesheet (AdwStyleManager *self)
                   NULL);
   }
 
+  if (enable_animations)
+    g_object_set (gtk_settings, "gtk-enable-animations", FALSE, NULL);
+
   self->setting_dark = TRUE;
 
   g_object_set (gtk_settings,
-                "gtk-enable-animations", FALSE,
                 "gtk-application-prefer-dark-theme", self->dark,
                 NULL);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]