Browse Source

Windows-Native: Initialize all struct members with a default value on construction.

pull/245/head
weisj 4 years ago committed by Jannis Weis
parent
commit
7bc2470a83
  1. 2
      windows/src/main/cpp/Decorations.cpp
  2. 2
      windows/src/main/cpp/ThemeInfo.cpp

2
windows/src/main/cpp/Decorations.cpp

@ -154,7 +154,7 @@ void UpdateRegion(WindowWrapper *wrapper) {
// Avoid unnecessarily updating the region to avoid unnecessary redraws // Avoid unnecessarily updating the region to avoid unnecessary redraws
if (EqualRect(&wrapper->rgn, &old_rgn)) return; if (EqualRect(&wrapper->rgn, &old_rgn)) return;
// Treat empty regions as NULL regions // Treat empty regions as NULL regions
RECT empty = { 0 }; RECT empty = { 0, 0, 0, 0 };
if (EqualRect(&wrapper->rgn, &empty)) SetWindowRgn(wrapper->window, NULL, TRUE); if (EqualRect(&wrapper->rgn, &empty)) SetWindowRgn(wrapper->window, NULL, TRUE);
else SetWindowRgn(wrapper->window, CreateRectRgnIndirect(&wrapper->rgn), TRUE); else SetWindowRgn(wrapper->window, CreateRectRgnIndirect(&wrapper->rgn), TRUE);
} }

2
windows/src/main/cpp/ThemeInfo.cpp

@ -85,7 +85,7 @@ std::string RegGetString(HKEY hKey, const LPCSTR subKey, const LPCSTR value) {
} }
bool IsHighContrastMode() { bool IsHighContrastMode() {
HIGHCONTRAST info = { 0 }; HIGHCONTRAST info = { 0, 0, 0 };
info.cbSize = sizeof(HIGHCONTRAST); info.cbSize = sizeof(HIGHCONTRAST);
BOOL ok = SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &info, 0); BOOL ok = SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &info, 0);
if (ok) { if (ok) {

Loading…
Cancel
Save