fix: tighten relevance gate focus handling
This commit is contained in:
@@ -140,6 +140,29 @@ class EventManagerRelevanceGateRegressionTests(unittest.TestCase):
|
||||
):
|
||||
self.assertFalse(self.manager._ignore(event))
|
||||
|
||||
def test_unfocused_focus_loss_is_dropped_when_focus_is_stable_elsewhere(self) -> None:
|
||||
app = object()
|
||||
focus = object()
|
||||
source = object()
|
||||
event = FakeEvent("object:state-changed:focused", source=source, detail1=0)
|
||||
cthulhu_state.activeScript = mock.Mock(app=app)
|
||||
cthulhu_state.locusOfFocus = focus
|
||||
|
||||
with (
|
||||
mock.patch.object(event_manager.debug, "printMessage"),
|
||||
mock.patch.object(event_manager.debug, "printTokens"),
|
||||
mock.patch.object(event_manager.debug, "print_log"),
|
||||
mock.patch.object(event_manager.AXObject, "get_application", return_value=app),
|
||||
mock.patch.object(event_manager.AXObject, "get_name", return_value="Chromium"),
|
||||
mock.patch.object(event_manager.AXObject, "get_role", return_value=event_manager.Atspi.Role.LINK),
|
||||
mock.patch.object(event_manager.AXObject, "is_dead", return_value=False),
|
||||
mock.patch.object(event_manager.AXUtilities, "has_no_state", return_value=False),
|
||||
mock.patch.object(event_manager.AXUtilities, "is_defunct", return_value=False),
|
||||
mock.patch.object(event_manager.AXUtilities, "is_notification", return_value=False),
|
||||
mock.patch.object(event_manager.AXUtilities, "is_alert", return_value=False),
|
||||
):
|
||||
self.assertTrue(self.manager._ignore(event))
|
||||
|
||||
def test_repeated_web_children_changed_burst_is_collapsed(self) -> None:
|
||||
app = object()
|
||||
focus = object()
|
||||
|
||||
Reference in New Issue
Block a user