Skip to content

Commit b2652ad

Browse files
committed
Disable theme awareness if we detect Wine.
1 parent b1a8063 commit b2652ad

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/musikcube/cursespp/Win32Util.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@ namespace cursespp {
264264
}
265265
}
266266

267+
static bool IsWine() {
268+
HMODULE ntdll = LoadLibrary(L"ntdll.dll");
269+
bool result = ntdll != nullptr && GetProcAddress(ntdll, "wine_get_version") != nullptr;
270+
FreeLibrary(ntdll);
271+
return result;
272+
}
273+
267274
void ConfigureDpiAwareness() {
268275
typedef HRESULT(__stdcall *SetProcessDpiAwarenessProc)(int);
269276
static const int ADJUST_DPI_PER_MONITOR = 2;
@@ -282,6 +289,10 @@ namespace cursespp {
282289
}
283290

284291
void ConfigureThemeAwareness() {
292+
if (IsWine()) {
293+
return;
294+
}
295+
285296
typedef HRESULT(__stdcall* DwmSetWindowAttributeProc)(HWND, DWORD, LPCVOID, DWORD);
286297
static const DWORD DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
287298

0 commit comments

Comments
 (0)