Handle unavailable registry in on_focus_changed.

This commit is contained in:
Florian Bruhin 2015-04-01 00:02:29 +02:00
parent 431257d380
commit eeb875d098

View File

@ -97,7 +97,12 @@ def on_focus_changed():
delta = datetime.datetime.now() - msg.time
log.misc.debug("Handling queued {} for window {}, delta {}".format(
msg.method_name, msg.win_id, delta))
bridge = _get_bridge(msg.win_id)
try:
bridge = _get_bridge(msg.win_id)
except objreg.RegistryUnavailableError:
# Non-mainwindow window focused.
_QUEUED.append(msg)
return
if delta.total_seconds() < 1:
text = msg.text
else: