From 2dd9166e2f2a3f33a5740c04f9d7ce6a03ba0709 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 1 Feb 2022 21:57:18 +0100 Subject: 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; -- cgit v1.2.1