Fix history: relax OnClick guard for non-model ops, track g_lastLoadedText after dictation

This commit is contained in:
Win Dictation Dev
2026-06-11 17:04:18 +12:00
parent d56260fdb9
commit 95af0f224b
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# Build directories
build/
build*/
deps/
*.vcxproj
*.vcxproj.filters
+4 -1
View File
@@ -1019,7 +1019,9 @@ int HitTest(POINT p) {
}
void OnClick(HWND hWnd, WK kind) {
if (!g_modelLoaded.load() && kind != WK::RecordHero) return;
if (!g_modelLoaded.load() && kind != WK::RecordHero && kind != WK::Clear
&& kind != WK::Copy && kind != WK::Paste && kind != WK::Pin
&& kind != WK::History && kind != WK::SettingsCog && kind != WK::SelAudio) return;
switch (kind) {
case WK::RecordHero:
PostMessage(hWnd, WM_HOTKEY, HK_TOGGLE, 0);
@@ -1551,6 +1553,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
SendMessageW(hEdit, EM_REPLACESEL, TRUE, (LPARAM)ins.c_str());
SendMessageW(hEdit, EM_SCROLLCARET, 0, 0);
UpdatePlaceholder(hWnd);
g_lastLoadedText = GetEditText(hWnd);
SetClipboardTextUtf8(hWnd, *res);