From 60e498ce2a3ffd044601ec8b8c8fcfcd46503b35 Mon Sep 17 00:00:00 2001 From: Joanmarie Diggs Date: Fri, 8 Jan 2021 15:27:56 +0100 Subject: [PATCH] Add more debugging --- src/orca/scripts/web/script_utilities.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py index e24f289e5..ba6f2073c 100644 --- a/src/orca/scripts/web/script_utilities.py +++ b/src/orca/scripts/web/script_utilities.py @@ -4634,22 +4634,36 @@ class Utilities(script_utilities.Utilities): def handleEventFromContextReplicant(self, event, replicant): if self.isDead(replicant): + msg = "WEB: Context replicant is dead." + debug.println(debug.LEVEL_INFO, msg, True) return False if not self.isDead(orca_state.locusOfFocus): + msg = "WEB: Not event from context replicant. locusOfFocus %s is not dead." \ + % orca_state.locusOfFocus + debug.println(debug.LEVEL_INFO, msg, True) return False path, role, name = self.getCaretContextPathRoleAndName() - if path != pyatspi.getPath(replicant): + replicantPath = pyatspi.getPath(replicant) + if path != replicantPath: + msg = "WEB: Not event from context replicant. Path %s != replicant path %s." \ + % (path, replicantPath) return False - if role != replicant.getRole(): + replicantRole = replicant.getRole() + if role != replicantRole: + msg = "WEB: Not event from context replicant. Role %s != replicant role %s." \ + % (role, replicantRole) return False notify = replicant.name != name documentFrame = self.documentFrame() obj, offset = self._caretContexts.get(hash(documentFrame.parent)) + msg = "WEB: Is event from context replicant. Notify: %s" % notify + debug.println(debug.LEVEL_INFO, msg, True) + orca.setLocusOfFocus(event, replicant, notify) self.setCaretContext(replicant, offset, documentFrame) return True -- GitLab