feat: make Windows 11 immersive mode configurable

This commit is contained in:
goat 2023-02-19 13:27:58 +01:00
parent 9c321b2c05
commit 1e40cabdc6
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
7 changed files with 97 additions and 20 deletions

View file

@ -204,17 +204,6 @@ void xivfixes::prevent_devicechange_crashes(bool bApply) {
)
return ShowWindow(hWnd, SW_MAXIMIZE);
if (uMsg == WM_CREATE) {
// While at it, also apply dark mode title bar to the game.
if (const auto dwmapi = LoadLibraryW(L"dwmapi.dll")) {
if (const auto fn = reinterpret_cast<decltype(&DwmSetWindowAttribute)>(GetProcAddress(dwmapi, "DwmSetWindowAttribute"))) {
const BOOL trueValue = TRUE;
fn(hWnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &trueValue, sizeof trueValue);
}
FreeLibrary(dwmapi);
}
}
return s_pfnGameWndProc(hWnd, uMsg, wParam, lParam);
});