Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nvaccess/nvda
Browse files Browse the repository at this point in the history
  • Loading branch information
codeofdusk committed Oct 1, 2020
2 parents 6850cb1 + dc0582e commit dc1a5f4
Show file tree
Hide file tree
Showing 28 changed files with 2,263 additions and 897 deletions.
23 changes: 15 additions & 8 deletions source/browseMode.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2007-2020 NV Access Limited, Babbage B.V. Thomas Stivers
# Copyright (C) 2007-2020 NV Access Limited, Babbage B.V., James Teh, Leonard de Ruijter,
# Thomas Stivers
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

Expand Down Expand Up @@ -1331,18 +1332,24 @@ def _set_selection(self, info, reason=controlTypes.REASON_CARET):
if not obj:
log.debugWarning("Invalid NVDAObjectAtStart")
return
followBrowseModeFocus= config.conf["virtualBuffers"]["autoFocusFocusableElements"]
if obj==self.rootNVDAObject:
return
if followBrowseModeFocus:
if focusObj and not eventHandler.isPendingEvents("gainFocus") and focusObj!=self.rootNVDAObject and focusObj != api.getFocusObject() and self._shouldSetFocusToObj(focusObj):
focusObj.setFocus()
obj.scrollIntoView()
if self.programmaticScrollMayFireEvent:
self._lastProgrammaticScrollTime = time.time()
self.passThrough=self.shouldPassThrough(focusObj,reason=reason)
# Queue the reporting of pass through mode so that it will be spoken after the actual content.
queueHandler.queueFunction(queueHandler.eventQueue, reportPassThrough, self)
if focusObj:
self.passThrough = self.shouldPassThrough(focusObj, reason=reason)
if (
not eventHandler.isPendingEvents("gainFocus")
and focusObj != self.rootNVDAObject
and focusObj != api.getFocusObject()
and self._shouldSetFocusToObj(focusObj)
):
followBrowseModeFocus = config.conf["virtualBuffers"]["autoFocusFocusableElements"]
if followBrowseModeFocus or self.passThrough:
focusObj.setFocus()
# Queue the reporting of pass through mode so that it will be spoken after the actual content.
queueHandler.queueFunction(queueHandler.eventQueue, reportPassThrough, self)

def _shouldSetFocusToObj(self, obj):
"""Determine whether an object should receive focus.
Expand Down
Loading

0 comments on commit dc1a5f4

Please sign in to comment.