|
2 | 2 | # A part of NonVisual Desktop Access (NVDA) |
3 | 3 | # This file is covered by the GNU General Public License. |
4 | 4 | # See the file COPYING for more details. |
5 | | -# Copyright (C) 2018-2019 NV Access Limited, Babbage B.V. |
| 5 | +# Copyright (C) 2018-2022 NV Access Limited, Babbage B.V., Cyrille Bougot |
6 | 6 |
|
7 | 7 | """Module containing the vision handler. |
8 | 8 |
|
@@ -283,6 +283,14 @@ def initializeProvider( |
283 | 283 | # We should handle this more gracefully, since this is no reason |
284 | 284 | # to stop a provider from loading successfully. |
285 | 285 | log.debugWarning("Error in initial focus after provider load", exc_info=True) |
| 286 | + try: |
| 287 | + self.initialNavigatorObject() |
| 288 | + except Exception: |
| 289 | + # initialNavigatorObject might fail in case NVDA's current navigator object is an object |
| 290 | + # for which property fetching raises an exception. |
| 291 | + # We should handle this more gracefully, since this is no reason |
| 292 | + # to stop a provider from loading successfully. |
| 293 | + log.debugWarning("Error in initial navigator object after provider load", exc_info=True) |
286 | 294 |
|
287 | 295 | def terminate(self) -> None: |
288 | 296 | self.extensionPoints = None |
@@ -348,3 +356,9 @@ def initialFocus(self) -> None: |
348 | 356 | # focus/review hasn't yet been initialized. |
349 | 357 | return |
350 | 358 | self.handleGainFocus(api.getFocusObject()) |
| 359 | + |
| 360 | + def initialNavigatorObject(self) -> None: |
| 361 | + if not api.getDesktopObject(): |
| 362 | + # focus/review hasn't yet been initialized. |
| 363 | + return |
| 364 | + self.handleReviewMove(api.getNavigatorObject()) |
0 commit comments