[orca] Event manager: Ignore children-changed when the child is a menu item



commit 50d1b8e06b2cd6571f10a88acf46f8f14789ef4b
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Apr 21 14:30:12 2022 +0200

    Event manager: Ignore children-changed when the child is a menu item
    
    We were already trying to do so, but gnome-shell has panels (rather than
    menus) with menu item children.

 src/orca/event_manager.py | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/orca/event_manager.py b/src/orca/event_manager.py
index e25402d45..4befa9981 100644
--- a/src/orca/event_manager.py
+++ b/src/orca/event_manager.py
@@ -367,6 +367,14 @@ class EventManager:
                 debug.println(debug.LEVEL_INFO, msg, True)
                 return True
 
+            # In normal apps we would have caught this from the parent role.
+            # But gnome-shell has panel parents adding/removing menu items.
+            if event.type.startswith('object:children-changed'):
+                if childRole == pyatspi.ROLE_MENU_ITEM:
+                    msg = 'EVENT MANAGER: Ignoring event type due to child role'
+                    debug.println(debug.LEVEL_INFO, msg, True)
+                    return True
+
         msg = 'EVENT MANAGER: Not ignoring due to lack of cause'
         debug.println(debug.LEVEL_INFO, msg, True)
         return False


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