[orca] Eliminate some double-presentation in the new selection/clipboard support



commit 9f19e26028760cc1cd33f16df219db469e6242dc
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Feb 14 17:14:45 2016 -0500

    Eliminate some double-presentation in the new selection/clipboard support

 src/orca/scripts/default.py |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index da7a5f8..3cf5bff 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2614,9 +2614,10 @@ class Script(script.Script):
         """Callback for object:text-selection-changed accessibility events."""
 
         obj = event.source
-        if self.utilities.handleUndoTextEvent(event):
-            self.updateBraille(obj)
-            return
+
+        # We won't handle undo here as it can lead to double-presentation.
+        # If there is an application for which text-changed events are
+        # missing upon undo, handle them in an app or toolkit script.
 
         self.utilities.handleTextSelectionChange(obj)
         self.updateBraille(obj)
@@ -2791,8 +2792,14 @@ class Script(script.Script):
             self.presentMessage(messages.CLIPBOARD_COPIED_FULL, messages.CLIPBOARD_COPIED_BRIEF)
             return
 
-        if self.utilities.isTextArea(orca_state.locusOfFocus):
-            return
+        try:
+            state = orca_state.locusOfFocus.getState()
+        except:
+            msg = "ERROR: Exception getting state of %s" % orca_state.locusOfFocus
+            debug.println(debug.LEVEL_INFO, msg, True)
+        else:
+            if state.contains(pyatspi.STATE_EDITABLE):
+                return
 
         self.presentMessage(messages.CLIPBOARD_CUT_FULL, messages.CLIPBOARD_CUT_BRIEF)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]