diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 28df117fdb..70c7191fe3 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -466,8 +466,13 @@ static void init_nvda(void) } } #endif - g_plat_win32_flags &= ~PLAT_WIN32_FLAG_USE_NVDA; - g_plat_win32_flags |= PLAT_WIN32_FLAG_USE_POWERSHELL; + /* The above code is executed on each accessibility speak event, so + * we should only revert to powershell if nvda_lib wasn't loaded previously, + * and we weren't able to load it on this call, or we don't HAVE_DYLIB */ + if ((g_plat_win32_flags & PLAT_WIN32_FLAG_USE_NVDA) && !nvda_lib) { + g_plat_win32_flags &= ~PLAT_WIN32_FLAG_USE_NVDA; + g_plat_win32_flags |= PLAT_WIN32_FLAG_USE_POWERSHELL; + } } #endif