orca r3952 - in trunk: . src/orca



Author: richb
Date: Tue Jun  3 19:17:17 2008
New Revision: 3952
URL: http://svn.gnome.org/viewvc/orca?rev=3952&view=rev

Log:
        * src/orca/orca.py:
          src/orca/focus_tracking_presenter.py:
          Fix for bug #530368 - Only move focus if the event is for the 
          focused/active window.


Modified:
   trunk/ChangeLog
   trunk/src/orca/focus_tracking_presenter.py
   trunk/src/orca/orca.py

Modified: trunk/src/orca/focus_tracking_presenter.py
==============================================================================
--- trunk/src/orca/focus_tracking_presenter.py	(original)
+++ trunk/src/orca/focus_tracking_presenter.py	Tue Jun  3 19:17:17 2008
@@ -605,9 +605,18 @@
                     # in use, and then issues a focus: event on the
                     # main window, which is a frame.]]]
                     #
-                    if (event.type == "window:activate") \
-                       or ((event.type.startswith("focus")) 
-                           and (event.source.getRole() == pyatspi.ROLE_FRAME)):
+                    # Added in a further check. We look for modal panels
+                    # that are now showing (such as gnome-screensaver-dialog).
+                    # See bug #530368 for more details.
+                    #
+                    eType = event.type
+                    if (eType == "window:activate") \
+                       or ((eType.startswith("focus")) 
+                         and (event.source.getRole() == pyatspi.ROLE_FRAME)) \
+                       or (eType.startswith("object:state-changed:showing")
+                         and (event.source.getRole() == pyatspi.ROLE_PANEL)
+                         and state.contains(pyatspi.STATE_MODAL)):
+
                         # We'll let someone else decide if it's important
                         # to stop speech or not.
                         #speech.stop()

Modified: trunk/src/orca/orca.py
==============================================================================
--- trunk/src/orca/orca.py	(original)
+++ trunk/src/orca/orca.py	Tue Jun  3 19:17:17 2008
@@ -183,6 +183,15 @@
     if obj == orca_state.locusOfFocus:
         return
 
+    # If this event is not for the currently active script, then just return.
+    #
+    if event and event.source and \
+       event.host_application and orca_state.activeScript:
+        currentApp = orca_state.activeScript.app
+        if currentApp != event.host_application and \
+           currentApp != event.source.getApplication():
+            return
+
     oldLocusOfFocus = orca_state.locusOfFocus
     try:
         # Just to see if we have a valid object.



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