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




commit bf185c3354b2bae983dbc0e9cb113a29a6d5a653
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 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 35603fd97..2ca1728bb 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -257,12 +257,17 @@ 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;
        }
+
+       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,14 +502,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.");
 
-       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]