[orca] More hunting down of zombie accessibles and things which crash gnome-shell
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] More hunting down of zombie accessibles and things which crash gnome-shell
- Date: Tue, 27 Dec 2011 05:04:35 +0000 (UTC)
commit 672ca59c63d316eac63ebf81574f70142917177b
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Dec 27 00:02:54 2011 -0500
More hunting down of zombie accessibles and things which crash gnome-shell
src/orca/event_manager.py | 14 ++++++++++++--
src/orca/input_event.py | 2 +-
src/orca/script.py | 14 +++++++++++++-
src/orca/script_utilities.py | 11 ++++++++++-
src/orca/speechdispatcherfactory.py | 1 +
5 files changed, 37 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/event_manager.py b/src/orca/event_manager.py
index 8c90392..d8e26e7 100644
--- a/src/orca/event_manager.py
+++ b/src/orca/event_manager.py
@@ -412,6 +412,16 @@ class EventManager:
if not event.source:
return False, "event.source? What event.source??"
+ role = state = None
+ try:
+ role = event.source.getRole()
+ except LookupError:
+ return False, "LookupError getting event.source's role"
+ try:
+ state = event.source.getState()
+ except LookupError:
+ return False, "LookupError getting event.source's state"
+
if not script:
script = self._getScriptForEvent(event)
@@ -436,8 +446,8 @@ class EventManager:
# This condition appears with gnome-screensave-dialog.
# See bug 530368.
if eType.startswith('object:state-changed:showing') \
- and event.source.getRole() == pyatspi.ROLE_PANEL \
- and event.source.getState().contains(pyatspi.STATE_MODAL):
+ and role == pyatspi.ROLE_PANEL \
+ and state.contains(pyatspi.STATE_MODAL):
return True, "Modal panel is showing."
return False, "No reason found to activate a different script."
diff --git a/src/orca/input_event.py b/src/orca/input_event.py
index e9cfd32..cd6ccf8 100644
--- a/src/orca/input_event.py
+++ b/src/orca/input_event.py
@@ -290,7 +290,7 @@ class KeyboardEvent(InputEvent):
if self.keyType:
return self.keyType == KeyboardEvent.TYPE_PRINTABLE
- if self.event_string == "space":
+ if self.event_string in ["space", " "]:
return True
unicodeString = self.event_string.decode("UTF-8")
diff --git a/src/orca/script.py b/src/orca/script.py
index 736e84b..f74c19b 100644
--- a/src/orca/script.py
+++ b/src/orca/script.py
@@ -377,11 +377,23 @@ class Script:
- event: the Event
"""
+ if not event.source:
+ msg = 'script.processObjectEvent: event.source went away'
+ debug.println(debug.LEVEL_FINE, msg)
+ return
+
+ try:
+ role = event.source.getRole()
+ except LookupError:
+ msg = 'script.processObjectEvent: LookupError getting role'
+ debug.println(debug.LEVEL_FINE, msg)
+ return
+
# Check to see if we really want to process this event.
#
processEvent = (orca_state.activeScript == self \
or self.presentIfInactive)
- if event.source.getRole() == pyatspi.ROLE_PROGRESS_BAR \
+ if role == pyatspi.ROLE_PROGRESS_BAR \
and not processEvent \
and settings.progressBarVerbosity == settings.PROGRESS_BAR_ALL:
processEvent = True
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index e141291..0f6d6c9 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -792,7 +792,16 @@ class Utilities:
def isLink(self, obj):
"""Returns True if obj is a link."""
- return obj and obj.getRole() == pyatspi.ROLE_LINK
+ if not obj:
+ return False
+
+ try:
+ role = obj.getRole()
+ except LookupError:
+ debug.println(debug.LEVEL_FINE, 'LookupError - isLink getting role')
+ return False
+
+ return role == pyatspi.ROLE_LINK
def isReadOnlyTextArea(self, obj):
"""Returns True if obj is a text entry area that is read only."""
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index b58b161..b3c83dc 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -83,6 +83,7 @@ class SpeechServer(speechserver.SpeechServer):
KEY_NAMES = {
'_': 'underscore',
+ ' ': 'space',
'space': 'space',
'"': 'double-quote',
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]