Created
June 29, 2025 17:35
-
-
Save tamr/1f1e3b06994a80e61dac87e5a80fb272 to your computer and use it in GitHub Desktop.
Fix mica's related compile errors and force dark mode on win10 for https://github.com/ozone10/winmerge/tree/DarkModeLib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Externals/darkmodelib/include/DarkModeSubclass.h | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/Externals/darkmodelib/include/DarkModeSubclass.h b/Externals/darkmodelib/include/DarkModeSubclass.h | |
index 913ed1ee1..43fc48da8 100644 | |
--- a/Externals/darkmodelib/include/DarkModeSubclass.h | |
+++ b/Externals/darkmodelib/include/DarkModeSubclass.h | |
@@ -103,7 +103,7 @@ namespace DarkMode | |
void setRoundCornerConfig(UINT roundCornerStyle); | |
void setBorderColorConfig(COLORREF clr); | |
// DWM_SYSTEMBACKDROP_TYPE values | |
- void setMicaConfig(UINT mica); | |
+ // void setMicaConfig(UINT mica); | |
void setMicaExtendedConfig(bool extendMica); | |
// enum DarkModeType { light = 0, dark = 1, classic = 3 }; values | |
void setDarkModeConfig(UINT dmType); | |
Externals/darkmodelib/src/DarkModeSubclass.cpp | 16 ++++++++-------- | |
1 file changed, 8 insertions(+), 8 deletions(-) | |
diff --git a/Externals/darkmodelib/src/DarkModeSubclass.cpp b/Externals/darkmodelib/src/DarkModeSubclass.cpp | |
index 0e1d8134c..9ffd4a1bc 100644 | |
--- a/Externals/darkmodelib/src/DarkModeSubclass.cpp | |
+++ b/Externals/darkmodelib/src/DarkModeSubclass.cpp | |
@@ -278,7 +278,7 @@ namespace DarkMode | |
{ | |
DWM_WINDOW_CORNER_PREFERENCE _roundCorner = DWMWCP_DEFAULT; | |
COLORREF _borderColor = DWMWA_COLOR_DEFAULT; | |
- DWM_SYSTEMBACKDROP_TYPE _mica = DWMSBT_AUTO; | |
+ //DWM_SYSTEMBACKDROP_TYPE _mica = DWMSBT_AUTO; | |
TreeViewStyle _treeViewStyle = TreeViewStyle::classic; | |
bool _micaExtend = false; | |
DarkModeType _dmType = DarkModeType::dark; | |
@@ -947,7 +947,7 @@ namespace DarkMode | |
} | |
} | |
- void setMicaConfig(UINT mica) | |
+ /*void setMicaConfig(UINT mica) | |
{ | |
const auto micaType = static_cast<DWM_SYSTEMBACKDROP_TYPE>(mica); | |
if (micaType > DWMSBT_TABBEDWINDOW) // || micaType < DWMSBT_AUTO) // should never be < 0 | |
@@ -958,7 +958,7 @@ namespace DarkMode | |
{ | |
g_dmCfg._mica = micaType; | |
} | |
- } | |
+ }*/ | |
void setMicaExtendedConfig(bool extendMica) | |
{ | |
@@ -990,7 +990,7 @@ namespace DarkMode | |
std::wstring sectionColorsView = sectionBase + L".colors.view"; | |
std::wstring sectionColors = sectionBase + L".colors"; | |
- DarkMode::setMicaConfig(::GetPrivateProfileInt(sectionBase.c_str(), L"mica", 0, iniPath.c_str())); | |
+ //DarkMode::setMicaConfig(::GetPrivateProfileInt(sectionBase.c_str(), L"mica", 0, iniPath.c_str())); | |
DarkMode::setRoundCornerConfig(::GetPrivateProfileInt(sectionBase.c_str(), L"roundCorner", 0, iniPath.c_str())); | |
setClrFromIni(sectionBase, L"borderColor", iniPath, &g_dmCfg._borderColor); | |
if (g_dmCfg._borderColor == 0xFFFFFF) | |
@@ -1221,14 +1221,14 @@ namespace DarkMode | |
{ | |
DWORD data{}; | |
DWORD dwBufSize = sizeof(data); | |
- LPCWSTR lpSubKey = L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; | |
+ /*LPCWSTR lpSubKey = L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; | |
LPCWSTR lpValue = L"AppsUseLightTheme"; | |
const auto result = ::RegGetValueW(HKEY_CURRENT_USER, lpSubKey, lpValue, RRF_RT_REG_DWORD, nullptr, &data, &dwBufSize); | |
if (result != ERROR_SUCCESS) | |
{ | |
return false; | |
- } | |
+ }*/ | |
// dark mode is 0, light mode is 1 | |
return data == 0UL; | |
@@ -5515,7 +5515,7 @@ namespace DarkMode | |
::DwmSetWindowAttribute(hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, &g_dmCfg._roundCorner, sizeof(g_dmCfg._roundCorner)); | |
::DwmSetWindowAttribute(hWnd, DWMWA_BORDER_COLOR, &g_dmCfg._borderColor, sizeof(g_dmCfg._borderColor)); | |
- if (DarkMode::getWindowsBuildNumber() >= win11Mica) | |
+ /*if (DarkMode::getWindowsBuildNumber() >= win11Mica) | |
{ | |
if (g_dmCfg._micaExtend && g_dmCfg._mica != DWMSBT_AUTO && !DarkMode::isWindowsModeEnabled() && (g_dmCfg._dmType == DarkModeType::dark)) | |
{ | |
@@ -5524,7 +5524,7 @@ namespace DarkMode | |
} | |
::DwmSetWindowAttribute(hWnd, DWMWA_SYSTEMBACKDROP_TYPE, &g_dmCfg._mica, sizeof(g_dmCfg._mica)); | |
- } | |
+ }*/ | |
} | |
} | |
#if defined(_DARKMODELIB_ALLOW_OLD_OS) | |
Src/Merge.cpp | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/Src/Merge.cpp b/Src/Merge.cpp | |
index f8ffb8cb1..92e508aa7 100644 | |
--- a/Src/Merge.cpp | |
+++ b/Src/Merge.cpp | |
@@ -422,7 +422,7 @@ BOOL CMergeApp::InitInstance() | |
DarkMode::initDarkMode(MERGE_INI_NAME); | |
} | |
#endif | |
- if (IsWin11_OrGreater()) | |
+ if (IsWin10_OrGreater()) | |
BCMenu::DisableOwnerDraw(); | |
m_bMergingMode = GetOptionsMgr()->GetBool(OPT_MERGE_MODE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remove "Menu Bar" context menu item in taskbar
Src\MainFrm.cpp