[orca/gnome-3-12] Eliminate some text-selection chattiness
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-12] Eliminate some text-selection chattiness
- Date: Tue, 18 Mar 2014 13:49:14 +0000 (UTC)
commit 11f3f223ca87183a52da6d861074c66445a39934
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Mar 18 09:48:29 2014 -0400
Eliminate some text-selection chattiness
src/orca/scripts/apps/soffice/script.py | 6 ++++++
src/orca/scripts/apps/soffice/script_utilities.py | 20 ++++++++++++++++++++
src/orca/scripts/default.py | 5 ++++-
3 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index 2929b75..98dae93 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -956,6 +956,9 @@ class Script(default.Script):
if start != end:
return
+ if self.utilities._flowsFromOrToSelection(event.source):
+ return
+
# We should present this in response to active-descendant-changed events
if event.source.getState().contains(pyatspi.STATE_MANAGES_DESCENDANTS):
return
@@ -1001,6 +1004,9 @@ class Script(default.Script):
[pyatspi.ROLE_FRAME]):
orca.setLocusOfFocus(event, event.source, False)
+ if self.utilities._flowsFromOrToSelection(event.source):
+ return
+
default.Script.onCaretMoved(self, event)
def onCheckedChanged(self, event):
diff --git a/src/orca/scripts/apps/soffice/script_utilities.py
b/src/orca/scripts/apps/soffice/script_utilities.py
index 4f65614..8f7b81f 100644
--- a/src/orca/scripts/apps/soffice/script_utilities.py
+++ b/src/orca/scripts/apps/soffice/script_utilities.py
@@ -474,6 +474,26 @@ class Utilities(script_utilities.Utilities):
return nextObj
+ @staticmethod
+ def _flowsFromOrToSelection(obj):
+ try:
+ relationSet = obj.getRelationSet()
+ except:
+ return False
+
+ flows = [pyatspi.RELATION_FLOWS_FROM, pyatspi.RELATION_FLOWS_TO]
+ relations = filter(lambda r: r.getRelationType() in flows, relationSet)
+ targets = [r.getTarget(0) for r in relations]
+ for target in targets:
+ try:
+ nSelections = target.queryText().getNSelections()
+ except:
+ return False
+ if nSelections:
+ return True
+
+ return False
+
#########################################################################
# #
# Impress-Specific Utilities #
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 24f16bc..4591d79 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2194,7 +2194,10 @@ class Script(script.Script):
text = event.source.queryText()
self._saveLastCursorPosition(event.source, text.caretOffset)
- if text.getNSelections():
+
+ textSelections = self.pointOfReference.get('textSelections', {})
+ start, end = textSelections.get(hash(event.source), (0, 0))
+ if text.getNSelections() or start != end:
return
self._presentTextAtNewCaretPosition(event)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]