[vte] widget: gtk4: Lower the priority of the style provider



commit 6beb9246d84d3161e1ea377417d0a2b9a8fb1e90
Author: Christian Persch <chpe src gnome org>
Date:   Mon Jul 25 22:25:08 2022 +0200

    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<typename T>
 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);


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