From 97d2d01fb10ebe92ba3ef5520ab9a2748d7a4fd9 Mon Sep 17 00:00:00 2001
From: c4pp4
Date: Mon, 14 Jul 2025 23:23:27 +0200
Subject: [PATCH 1/1] Ambiance theme prefer light

Signed-off-by: c4pp4
---
 vcl/unx/gtk3/gtkframe.cxx | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 5d99e23d0..ad073f9b9 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -39,6 +39,7 @@
 #include <vcl/window.hxx>
 #include <vcl/settings.hxx>
 
+#include <gio/gio.h>
 #include <gtk/gtk.h>
 
 #include <X11/Xlib.h>
@@ -1372,7 +1373,21 @@ void GtkSalFrame::SetColorScheme(GVariant* variant)
         default:
         case 0: // Auto
         {
-            if (variant)
+            bool bAmbiance = false;
+            GSettings* pGtkSettings = g_settings_new("org.gnome.desktop.interface");
+            if (pGtkSettings)
+            {
+                g_autofree gchar* themeName = g_settings_get_string(pGtkSettings, "gtk-theme");
+                if (themeName && g_strcmp0(themeName, "Ambiance") == 0)
+                    bAmbiance = true;
+                g_object_unref(pGtkSettings);
+            }
+
+            if (bAmbiance)
+            {
+                color_scheme = PREFER_LIGHT;
+            }
+            else if (variant)
             {
                 color_scheme = g_variant_get_uint32(variant);
                 if (color_scheme > PREFER_LIGHT)
-- 
2.49.1

