Skip to content

Commit 0091398

Browse files
committed
Fix the Cygwin w32 build broken by adding the dark theme support
* src/w32fns.c (w32_applytheme): Make a no-op for Cygwin w32 builds. (globals_of_w32fns): Don't attempt to load dwmapi.dll and uxtheme.dll in the Cygwin w32 build. (Bug#51583)
1 parent 4ddaed3 commit 0091398

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/w32fns.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,10 @@ int w32_major_version;
273273
int w32_minor_version;
274274
int w32_build_number;
275275

276+
#ifndef CYGWIN
276277
/* If the OS is set to use dark mode. */
277278
BOOL w32_darkmode = FALSE;
279+
#endif
278280

279281
/* Distinguish between Windows NT and Windows 95. */
280282
int os_subtype;
@@ -2308,6 +2310,7 @@ w32_init_class (HINSTANCE hinst)
23082310
static void
23092311
w32_applytheme (HWND hwnd)
23102312
{
2313+
#ifndef CYGWIN
23112314
if (w32_darkmode)
23122315
{
23132316
/* Set window theme to that of a built-in Windows app (Explorer),
@@ -2327,6 +2330,7 @@ w32_applytheme (HWND hwnd)
23272330
&w32_darkmode, sizeof (w32_darkmode));
23282331
}
23292332
}
2333+
#endif
23302334
}
23312335

23322336
static HWND
@@ -11087,6 +11091,7 @@ globals_of_w32fns (void)
1108711091
set_thread_description = (SetThreadDescription_Proc)
1108811092
get_proc_addr (hm_kernel32, "SetThreadDescription");
1108911093

11094+
#ifndef CYGWIN
1109011095
/* Support OS dark mode on Windows 10 version 1809 and higher.
1109111096
See `w32_applytheme` which uses appropriate APIs per version of Windows.
1109211097
For future wretches who may need to understand Windows build numbers:
@@ -11117,6 +11122,7 @@ globals_of_w32fns (void)
1111711122
if (val && *val == 0)
1111811123
w32_darkmode = TRUE;
1111911124
}
11125+
#endif
1112011126

1112111127
except_code = 0;
1112211128
except_addr = 0;

0 commit comments

Comments
 (0)