Skip to content

Commit

Permalink
Disable theme awareness if we detect Wine.
Browse files Browse the repository at this point in the history
  • Loading branch information
clangen committed Feb 6, 2023
1 parent b1a8063 commit b2652ad
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/musikcube/cursespp/Win32Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit b2652ad

Please sign in to comment.