[orca] Handle more cases of defunct applications emitting events
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Handle more cases of defunct applications emitting events
- Date: Tue, 9 Jun 2015 14:48:56 +0000 (UTC)
commit 4875b8bc607e82ea86a7b35563d35ebacd5cf0ba
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Jun 9 10:48:24 2015 -0400
Handle more cases of defunct applications emitting events
src/orca/event_manager.py | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/event_manager.py b/src/orca/event_manager.py
index cdf76e8..379a702 100644
--- a/src/orca/event_manager.py
+++ b/src/orca/event_manager.py
@@ -623,8 +623,18 @@ class EventManager:
debug.println(debug.LEVEL_FINEST, "Script for event: %s" % script.name)
setNewActiveScript, reason = self._isActivatableEvent(event, script)
if setNewActiveScript:
- app = event.host_application or event.source.getApplication()
- _scriptManager.setActiveScript(script, reason)
+ try:
+ app = event.host_application or event.source.getApplication()
+ except:
+ msg = 'ERROR: Could not get application for %s' % event.source
+ debug.println(debug.LEVEL_INFO, msg)
+ return
+ try:
+ _scriptManager.setActiveScript(script, reason)
+ except:
+ msg = 'ERROR: Could not set active script for %s' % event.source
+ debug.println(debug.LEVEL_INFO, msg)
+ return
try:
script.processObjectEvent(event)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]