Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion titlebar.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ fn C.DwmSetWindowAttribute(voidptr, u32, &u8, u32)
// titlebar_dark set the window titlebar to be dark or light, api is from dwmapi.h, windows 10+ only
pub fn titlebar_dark(dark bool) {
$if windows {
C.DwmSetWindowAttribute(sapp.win32_get_hwnd(), 20, &dark, sizeof(dark))
// set_theme() can run before sapp.run(); win32_get_hwnd() then
// aborts on `_sapp.valid`. Guard with isvalid().
if sapp.isvalid() {
C.DwmSetWindowAttribute(sapp.win32_get_hwnd(), 20, &dark, sizeof(dark))
}
}
}