From: Jeremy Bicha <jbicha@debian.org>
Date: Wed, 16 Feb 2022 11:14:22 -0500
Subject: Support GNOME 42 dark theme preference

'--disable-since-check' is only needed until libhandy 1.6 is available
---
 meson.build          | 1 +
 src/gnome-mines.vala | 3 +++
 src/meson.build      | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 3f33d5a..75e2eb9 100644
--- a/meson.build
+++ b/meson.build
@@ -24,6 +24,7 @@ glib_dep = dependency ('glib-2.0', version: '>= 2.40.0')
 gee_dep = dependency ('gee-0.8')
 gtk_dep = dependency ('gtk+-3.0', version: '>= 3.24')
 librsvg_dep = dependency ('librsvg-2.0', version: '>=2.32.0')
+libhandy_dep = dependency ('libhandy-1', version: '>=1.5.90')
 libgnome_games_support_dep = dependency ('libgnome-games-support-1', version: '>= 1.7.1')
 libmath_dep = cc.find_library('m')
 
diff --git a/src/gnome-mines.vala b/src/gnome-mines.vala
index 9e633ef..e823551 100644
--- a/src/gnome-mines.vala
+++ b/src/gnome-mines.vala
@@ -169,6 +169,9 @@ public class Mines : Gtk.Application
     {
         base.startup ();
 
+        Hdy.init ();
+        Hdy.StyleManager.get_default().set_color_scheme(Hdy.ColorScheme.PREFER_LIGHT);
+
         Environment.set_application_name (_("Mines"));
 
         settings = new GLib.Settings ("org.gnome.Mines");
diff --git a/src/meson.build b/src/meson.build
index de26471..0da4866 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -12,10 +12,11 @@ gnome_mines = executable ('gnome-mines',
                           dependencies: [ glib_dep,
                                           gee_dep,
                                           gtk_dep,
+                                          libhandy_dep,
                                           librsvg_dep,
                                           libmath_dep,
                                           libgnome_games_support_dep ],
-                          vala_args: [ '--pkg=posix' ],
+                          vala_args: [ '--pkg=posix', '--disable-since-check'],
                           c_args: [ '-DVERSION="@0@"'.format (meson.project_version ()),
                                     '-DGETTEXT_PACKAGE="gnome-mines"',
                                     '-DLOCALEDIR="@0@"'.format (localedir),
