fix: tighten relevance gate focus handling

This commit is contained in:
2026-04-09 11:03:08 -04:00
parent 45b57b4d13
commit 16004af7c1
2 changed files with 29 additions and 2 deletions

View File

@@ -251,7 +251,7 @@ class EventManager:
liveAttr = AXObject.get_attribute(obj, 'live')
containerLive = AXObject.get_attribute(obj, 'container-live')
except Exception:
return False
return isinstance(obj, Atspi.Accessible)
if liveAttr in ('assertive', 'polite') or containerLive in ('assertive', 'polite'):
return True
@@ -333,7 +333,11 @@ class EventManager:
return self.RELEVANCE_KEEP
if event.type.startswith("object:state-changed:focused"):
return self.RELEVANCE_KEEP
if event.detail1 or cthulhu_state.locusOfFocus is None:
return self.RELEVANCE_KEEP
if self._eventTouchesCurrentFocusContext(event):
return self.RELEVANCE_KEEP
return self.RELEVANCE_DROP
role = self._eventRoleForRelevance(event)
eventGroup = self._relevanceEventGroup(event, role)