[totem/wip/hadess/startup-warning] main: Fix warning starting remote application




commit 2dd9166e2f2a3f33a5740c04f9d7ce6a03ba0709
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 1 21:57:18 2022 +0100

    main: Fix warning starting remote application
    
    (totem:2268540): Gtk-CRITICAL **: 21:59:00.013: gtk_style_context_add_provider_for_screen: assertion 
'GDK_IS_SCREEN (screen)' failed
    (totem:2268540): GLib-GObject-WARNING **: 21:59:00.013: invalid (NULL) pointer instance
    etc.
    
    Fixes: a784629f446f024bc585a9484fd0e119f7f28fcb

 src/totem-object.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index bd8fde913..d1c82e6f2 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -257,7 +257,6 @@ 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);
@@ -265,9 +264,13 @@ totem_object_app_handle_local_options (GApplication *application,
                return 1;
        }
 
-       hdy_init ();
-       style_manager = hdy_style_manager_get_default ();
-       hdy_style_manager_set_color_scheme (style_manager, HDY_COLOR_SCHEME_FORCE_DARK);
+       if (!g_application_get_is_remote (application)) {
+               HdyStyleManager *style_manager;
+
+               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;


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