[orca] Check if we're inside a menu when looking for object under mouse
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Check if we're inside a menu when looking for object under mouse
- Date: Thu, 28 Jun 2018 23:33:11 +0000 (UTC)
commit 8c6ae3154ef41ffd1b752fafca596b20f0b953db
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Jun 28 18:54:34 2018 -0400
Check if we're inside a menu when looking for object under mouse
src/orca/mouse_review.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/mouse_review.py b/src/orca/mouse_review.py
index 9da1bfd12..16545d89b 100644
--- a/src/orca/mouse_review.py
+++ b/src/orca/mouse_review.py
@@ -356,7 +356,14 @@ class MouseReviewer:
if not script:
return
- obj = script.utilities.descendantAtPoint(window, pX, pY)
+ isMenu = lambda x: x and x.getRole() == pyatspi.ROLE_MENU
+ if isMenu(orca_state.locusOfFocus):
+ menu = orca_state.locusOfFocus
+ else:
+ menu = pyatspi.findAncestor(orca_state.locusOfFocus, isMenu)
+
+ obj = script.utilities.descendantAtPoint(menu, pX, pY) \
+ or script.utilities.descendantAtPoint(window, pX, pY)
msg = "MOUSE REVIEW: Object at (%i, %i) is %s" % (pX, pY, obj)
debug.println(debug.LEVEL_INFO, msg, True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]