From e06dd9ae61460d7132b9a92acaf56978c69a019a Mon Sep 17 00:00:00 2001 From: Jerome Martinez Date: Fri, 31 May 2024 07:29:48 +0200 Subject: [PATCH] x Windows GUI dark mode: avoid an unexpected popup --- Source/GUI/VCL/GUI_Main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/GUI/VCL/GUI_Main.cpp b/Source/GUI/VCL/GUI_Main.cpp index 8ab1ac570..8a5b5dae7 100644 --- a/Source/GUI/VCL/GUI_Main.cpp +++ b/Source/GUI/VCL/GUI_Main.cpp @@ -2062,7 +2062,8 @@ void __fastcall TMainF::ApplicationEvents1OnSettingChange( TObject* Sender, int Flag, const UnicodeString Section, int &Result) { if (Section == "ImmersiveColorSet") { - if (WindowsDarkModeEnabled()) { + M_View_EasyClick(NULL); // This is for avoiding a popup "Cannot focus a disabled or invisible window when another view is selected. TODO: better handle of this issue + if (WindowsDarkModeEnabled()) { TStyleManager::TrySetStyle(DARK_MODE_STYLE, false); M_Options_Darkmode->Checked = true; } else {