[totem/wip/cdavis/force-dark: 2/3] main: Only force dark style after options are parsed




commit b9b6ed0da22b9e9a37c7ca8106bee07c48ead373
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 26 13:31:26 2022 +0100

    main: Only force dark style after options are parsed
    
    And the application is registered.

 src/totem-object.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 98fa654a5..bd8fde913 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -257,12 +257,18 @@ totem_object_app_handle_local_options (GApplication *application,
                                       GVariantDict *options)
 {
        GError *error = NULL;
+       HdyStyleManager *style_manager;
 
        if (!g_application_register (application, NULL, &error)) {
                g_warning ("Failed to register application: %s", error->message);
                g_error_free (error);
                return 1;
        }
+
+       hdy_init ();
+       style_manager = hdy_style_manager_get_default ();
+       hdy_style_manager_set_color_scheme (style_manager, HDY_COLOR_SCHEME_FORCE_DARK);
+
        totem_options_process_for_server (TOTEM_OBJECT (application), &optionstate);
        return 0;
 }
@@ -497,15 +503,9 @@ totem_object_class_init (TotemObjectClass *klass)
 static void
 totem_object_init (TotemObject *totem)
 {
-       HdyStyleManager *style_manager;
-
        if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)
                g_warning ("gtk-clutter failed to initialise, expect problems from here on.");
 
-       hdy_init ();
-       style_manager = hdy_style_manager_get_default ();
-       hdy_style_manager_set_color_scheme (style_manager, HDY_COLOR_SCHEME_FORCE_DARK);
-
        totem->settings = g_settings_new (TOTEM_GSETTINGS_SCHEMA);
 
        g_application_add_main_option_entries (G_APPLICATION (totem), all_options);


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