[orca] Also clear active script when we get an event for the defunct active window



commit 73de1ea428cc832addddeed2a1d327974efac9e1
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Feb 24 21:16:01 2020 +0100

    Also clear active script when we get an event for the defunct active window
    
    When a window is deactivated, but not defunct/dead, the default script
    clears the locusOfFocus and the active window AND the active script. But
    the event manager was only clearing the first two when handling the window
    going defunct/dead on us. This can cause us to have a stale/bogus active
    script. Therefore, follow the same behavior as the default script.
    
    Note: Given a badly behaved window manager / switcher, some recovery work
    will be needed to update our state. This will be done in a subsequent
    commit as it's arguably a separate problem and one which exists even if
    we don't change the event manager.

 src/orca/event_manager.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/event_manager.py b/src/orca/event_manager.py
index 563d3b5e1..de75eea79 100644
--- a/src/orca/event_manager.py
+++ b/src/orca/event_manager.py
@@ -716,10 +716,11 @@ class EventManager:
             debug.println(debug.LEVEL_INFO, msg, True)
             if eType.startswith("window:deactivate") or eType.startswith("window:destroy") \
                and orca_state.activeWindow == event.source:
-                msg = 'EVENT MANAGER: Clearing active window and locus of focus'
+                msg = 'EVENT MANAGER: Clearing active window, script, and locus of focus'
                 debug.println(debug.LEVEL_INFO, msg, True)
                 orca_state.locusOfFocus = None
                 orca_state.activeWindow = None
+                orca_state.activeScript = None
             return
 
         if state and state.contains(pyatspi.STATE_ICONIFIED):


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