Skip to content

Commit

Permalink
Don't crash when turning on Voice Access (#14534)
Browse files Browse the repository at this point in the history
I should have checked the `wparam`. 

Regressed in #14064.

Tested manually. No more crashy. 

Closes #14504
  • Loading branch information
zadjii-msft authored Dec 12, 2022
1 parent 2668273 commit 58ce22d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/cascadia/WindowsTerminal/IslandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,13 +660,19 @@ long IslandWindow::_calculateTotalSize(const bool isWidth, const long clientSize
}
case WM_SETTINGCHANGE:
{
const std::wstring param{ (wchar_t*)lparam };
// ImmersiveColorSet seems to be the notification that the OS theme
// changed. If that happens, let the app know, so it can hot-reload
// themes, color schemes that might depend on the OS theme
if (param == L"ImmersiveColorSet")
// Currently, we only support checking when the OS theme changes. In
// that case, wParam is 0. Re-evaluate when we decide to reload env vars
// (GH#1125)
if (wparam == 0)
{
_UpdateSettingsRequestedHandlers();
const std::wstring param{ (wchar_t*)lparam };
// ImmersiveColorSet seems to be the notification that the OS theme
// changed. If that happens, let the app know, so it can hot-reload
// themes, color schemes that might depend on the OS theme
if (param == L"ImmersiveColorSet")
{
_UpdateSettingsRequestedHandlers();
}
}
break;
}
Expand Down

0 comments on commit 58ce22d

Please sign in to comment.