From 6beb9246d84d3161e1ea377417d0a2b9a8fb1e90 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 25 Jul 2022 22:25:08 +0200 Subject: widget: gtk4: Lower the priority of the style provider Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2567 --- src/vtegtk.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vtegtk.cc b/src/vtegtk.cc index e8e4da30..235faac9 100644 --- a/src/vtegtk.cc +++ b/src/vtegtk.cc @@ -79,6 +79,15 @@ #define VTE_TERMINAL_CSS_NAME "vte-terminal" +/* Note that the exact priority used is an implementation detail subject to change + * and *not* an API guarantee. + * */ +#if VTE_GTK == 3 +#define VTE_TERMINAL_CSS_PRIORITY (GTK_STYLE_PROVIDER_PRIORITY_APPLICATION) +#elif VTE_GTK == 4 +#define VTE_TERMINAL_CSS_PRIORITY (GTK_STYLE_PROVIDER_PRIORITY_APPLICATION - 2) +#endif + template constexpr bool check_enum_value(T value) noexcept; @@ -844,7 +853,7 @@ try context = gtk_widget_get_style_context(&terminal->widget); gtk_style_context_add_provider (context, VTE_TERMINAL_GET_CLASS (terminal)->priv->style_provider, - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + VTE_TERMINAL_CSS_PRIORITY); #if VTE_GTK == 3 gtk_widget_set_has_window(&terminal->widget, FALSE); -- cgit v1.2.1