Disable theme awareness if we detect Wine.

This commit is contained in:
casey langen 2023-02-05 18:44:00 -08:00
parent b1a8063e13
commit b2652ad643

View File

@ -264,6 +264,13 @@ namespace cursespp {
}
}
static bool IsWine() {
HMODULE ntdll = LoadLibrary(L"ntdll.dll");
bool result = ntdll != nullptr && GetProcAddress(ntdll, "wine_get_version") != nullptr;
FreeLibrary(ntdll);
return result;
}
void ConfigureDpiAwareness() {
typedef HRESULT(__stdcall *SetProcessDpiAwarenessProc)(int);
static const int ADJUST_DPI_PER_MONITOR = 2;
@ -282,6 +289,10 @@ namespace cursespp {
}
void ConfigureThemeAwareness() {
if (IsWine()) {
return;
}
typedef HRESULT(__stdcall* DwmSetWindowAttributeProc)(HWND, DWORD, LPCVOID, DWORD);
static const DWORD DWMWA_USE_IMMERSIVE_DARK_MODE = 20;