nvda
24820590 - Fix screen curtain reporting a failure when the magnifier cannot be restarted, and reduce verbosity (#21099)

Commit
13 days ago
Fix screen curtain reporting a failure when the magnifier cannot be restarted, and reduce verbosity (#21099) Fixes #20518 Fixes #19528 Summary of the issue: When the Screen Curtain is disabled, it restarts the Magnifier if it was active before. If the Magnifier then failed to determine what to follow — the log in #20518 shows a COMError from the review position — the exception propagated out of ScreenCurtain.disable(). The Screen Curtain script then reported "Could not disable screen curtain", although the curtain had been disabled. The Magnifier was left marked active without actually magnifying. Separately, toggling the Screen Curtain with the Magnifier active announced "Disabling magnifier" and "Re-enabling magnifier", which #19528 found too verbose. Description of user facing changes: Disabling the Screen Curtain reports "Screen curtain disabled" whenever it actually is disabled. The Magnifier is restarted even if it cannot immediately determine what to follow; it starts at the centre of the screen. If the Magnifier cannot be restarted, the reason is still reported. Toggling the Screen Curtain no longer announces that the Magnifier is being disabled or re-enabled. Description of developer facing changes: None. Description of development approach: Three commits, matching the analysis in #20518, plus the changelog: Magnifier._startMagnifier handles failures to determine the tracked position. It catches the same exception types that Stop review position errors from crashing the magnifier #20992 turns into LocationUnavailableError. Stop review position errors from crashing the magnifier #20992 absorbs the Error when disabling screen curtain and reenabling Magnifier #20518 review position error inside the focus manager; this guard fixes it on master today and remains a safety net afterwards. Programming errors still propagate. ScreenCurtain.enable() and disable() isolate their Magnifier notifications. A Magnifier failure is logged and does not affect the Screen Curtain's outcome; in particular it can no longer prevent the screen from being hidden. The "Disabling magnifier" and "Re-enabling magnifier" announcements are removed. The existing MagnifierStartError messages are kept, so a failed restart is still reported with its reason. No new strings. Depends on #20992. This PR makes _startMagnifier() survive a failure to determine what to track, but the update loop that runs immediately afterwards still reads the same position. On master that loop counts a tracking failure as a magnification failure, so a persistent failure can still stop the magnifier a few ticks after the restart. #20992 rewrites that loop and fixes exactly this, so it is not duplicated here. The failure reported in #20518 is a transient one and is fixed by this PR alone. Compatible with #21034: its "Magnification API unavailable" case raises MagnifierStartError, which this path already reports.
Author
Parents
Loading