Commit 37a3863f authored by anonym's avatar anonym Committed by Vitezslav Humpa

Add support for only searching among 'showing' nodes.

Here 'showing' refers to pyatspi.STATE_SHOWING, i.e. whether a node is
shown to the end-user or not. Quite often we are only interested in
such nodes, at least when dogtail is used to interact with an
application (e.g. clicking something that isn't there won't
work). Most importantly, this greatly simplifies situations where the
'shown' element we are looking for is hard to exactly pinpoint since
it lacks properties to distinguish it from some not 'shown' elements,
which is quite common when nodes lack names.

Therefore we add a `showingOnly` boolean flag to all Node search
methods. The default will be to not do this, for backwards
compatibility, but the default is configurable via a new
`searchShowingOnly` config option.
parent d954436c
Pipeline #1718309 failed with stages
......@@ -58,6 +58,9 @@ class _Config(object):
searchCutoffCount (int):
Number of times to retry when a search fails.
searchShowingOnly (boolean):
Whether to only search among nodes that are currently being shown.
defaultDelay (float):
Default time in seconds to sleep when delaying.
......@@ -134,6 +137,7 @@ class _Config(object):
'searchBackoffDuration': 0.5,
'searchWarningThreshold': 3,
'searchCutoffCount': 20,
'searchShowingOnly': False,
'defaultDelay': 0.5,
'childrenLimit': 100,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment