From: Toni Wilen Date: Thu, 28 Dec 2023 16:44:50 +0000 (+0200) Subject: Initialize dark mode also when emulation window is opened. X-Git-Tag: 5200~113 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=1aa3b031376f8aecc39e1fea5c8b9269716c3584;p=francis%2Fwinuae.git Initialize dark mode also when emulation window is opened. --- diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 1f4af365..39a504ad 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -8252,12 +8252,19 @@ bool is_mainthread(void) return GetCurrentThreadId() == mainthreadid; } -void InitializeDarkMode(int v) +void InitializeDarkMode(void) { static int initialized = -10; + + int v = -1; + regqueryint(NULL, _T("GUIDarkMode"), &v); + if (rp_isactive()) { + v = -2; + } if (darkModeForced) { v = 1; } + if (initialized != v) { InitDarkMode(v); write_log("dark mode supported: %d enabled: %d\n", g_darkModeSupported, g_darkModeEnabled); diff --git a/od-win32/win32.h b/od-win32/win32.h index a969a89d..96c30879 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -75,7 +75,7 @@ extern void updatemouseclip(struct AmigaMonitor*); extern void updatewinrect(struct AmigaMonitor*, bool); int getdpiformonitor(HMONITOR mon); int getdpiforwindow(HWND hwnd); -void InitializeDarkMode(int v); +void InitializeDarkMode(void); extern bool resumepaused (int priority); extern bool setpaused (int priority); diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 22f0e4b5..844fec4c 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -3137,6 +3137,7 @@ void machdep_free(void) int graphics_init(bool mousecapture) { + InitializeDarkMode(); systray (hHiddenWnd, TRUE); systray (hHiddenWnd, FALSE); d3d_select(&currprefs); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 36d20bf7..32171950 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -23407,10 +23407,7 @@ static int GetSettings (int all_options, HWND hwnd) v = -1; regqueryint(NULL, _T("GUIDarkMode"), &v); gui_darkmode = v; - if (rp_isactive()) { - v = -2; - } - InitializeDarkMode(v); + InitializeDarkMode(); v = 0; regqueryint(NULL, _T("GUIFullscreen"), &v); if (v) {