[orca/gnome-3-34] Don't present GtkComboBox selection changes if we're not on/in that widget
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-34] Don't present GtkComboBox selection changes if we're not on/in that widget
- Date: Thu, 17 Oct 2019 09:38:02 +0000 (UTC)
commit e0a026f9aca68f9f4aae265a66196f3f1b038d49
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Oct 16 13:04:25 2019 -0400
Don't present GtkComboBox selection changes if we're not on/in that widget
src/orca/script_utilities.py | 6 ++++++
src/orca/scripts/toolkits/gtk/script.py | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index d376758ab..167d49f80 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -759,6 +759,12 @@ class Utilities:
def isTypeahead(self, obj):
return False
+ def isOrDescendsFrom(self, obj, ancestor):
+ if obj == ancestor:
+ return True
+
+ return pyatspi.findAncestor(obj, lambda x: x and x == ancestor)
+
def isFunctionalDialog(self, obj):
"""Returns True if the window is a functioning as a dialog.
This method should be subclassed by application scripts as
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index 1e0d0df4e..b3e32c016 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -176,7 +176,8 @@ class Script(default.Script):
def onSelectionChanged(self, event):
"""Callback for object:selection-changed accessibility events."""
- if self.utilities.isComboBoxWithToggleDescendant(event.source):
+ if self.utilities.isComboBoxWithToggleDescendant(event.source) \
+ and self.utilities.isOrDescendsFrom(orca_state.locusOfFocus, event.source):
super().onSelectionChanged(event)
return
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]