[orca] Try to avoid crashing Nautilus
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Try to avoid crashing Nautilus
- Date: Wed, 22 Apr 2020 17:31:10 +0000 (UTC)
commit ef42f11779484883151a8fc8ac75d170fe0db273
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Apr 22 13:28:48 2020 -0400
Try to avoid crashing Nautilus
The docs for atk_text_get_text() says callers can use -1 as the value
for end_offset. Turns out this causes Nautilus's icon view to segfault.
So for now, don't do what we should be able to do.
src/orca/script_utilities.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index e15a772bc..9eea10f7e 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -547,7 +547,9 @@ class Utilities:
return name
if 'Text' in pyatspi.listInterfaces(obj):
- displayedText = obj.queryText().getText(0, -1)
+ # We should be able to use -1 for the final offset, but that crashes Nautilus.
+ text = obj.queryText()
+ displayedText = text.getText(0, text.characterCount)
if self.EMBEDDED_OBJECT_CHARACTER in displayedText:
displayedText = None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]