From fe55b260b4915622d076c2c50f44d183d974b40b Mon Sep 17 00:00:00 2001 From: SoftFever Date: Thu, 26 Mar 2026 16:22:07 +0800 Subject: [PATCH] suppress: gtk_style_context_add_provider: assertion 'GTK_IS_STYLE_CONTEXT (context)' failed --- src/slic3r/GUI/GUI_App.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 47dcc64d78..e4e35e879b 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -2708,11 +2708,15 @@ bool GUI_App::on_init_inner() #if defined(__WXGTK20__) || defined(__WXGTK3__) // Suppress harmless GTK critical warnings from the GTK3/wxWidgets interaction. - // These include widget allocation on hidden widgets and events on unrealized widgets. + // These include widget allocation on hidden widgets, events on unrealized widgets, + // and style context operations during widget construction (SetBackgroundColour + // before GTK widget realization). g_log_set_handler("Gtk", G_LOG_LEVEL_CRITICAL, [](const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { if (message && (strstr(message, "gtk_widget_set_allocation") || - strstr(message, "WIDGET_REALIZED_FOR_EVENT"))) + strstr(message, "WIDGET_REALIZED_FOR_EVENT") || + strstr(message, "gtk_widget_get_style_context") || + strstr(message, "gtk_style_context_add_provider"))) return; g_log_default_handler(log_domain, log_level, message, user_data); }, nullptr);