OSDN Git Service

Mozilla Gecko 2 removes all child windows and only now contains one root window which...
authorMichael Curran <mick@kulgan.net>
Thu, 9 Sep 2010 19:38:49 +0000 (05:38 +1000)
committerMichael Curran <mick@kulgan.net>
Thu, 9 Sep 2010 19:38:49 +0000 (05:38 +1000)
source/IAccessibleHandler.py
source/NVDAHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp
source/NVDAObjects/IAccessible/__init__.py

index 56ab2cc..31486ea 100644 (file)
@@ -560,8 +560,12 @@ def winEventCallback(handle,eventID,window,objectID,childID,threadID,timestamp):
                        return\r
 \r
                if childID<0:\r
-                       while window and not winUser.getWindowStyle(window)&winUser.WS_POPUP and winUser.getClassName(window)=="MozillaWindowClass":\r
-                               window=winUser.getAncestor(window,winUser.GA_PARENT)\r
+                       tempWindow=window\r
+                       while tempWindow and not winUser.getWindowStyle(tempWindow)&winUser.WS_POPUP and winUser.getClassName(tempWindow)=="MozillaWindowClass":\r
+                               tempWindow=winUser.getAncestor(tempWindow,winUser.GA_PARENT)\r
+                       if tempWindow and winUser.getClassName(tempWindow).startswith('Mozilla'):\r
+                               window=tempWindow\r
+\r
                windowClassName=winUser.getClassName(window)\r
                #At the moment we can't handle show, hide or reorder events on Mozilla Firefox Location bar,as there are just too many of them\r
                #Ignore show, hide and reorder on MozillaDropShadowWindowClass windows.\r
@@ -624,8 +628,8 @@ def processFocusWinEvent(window,objectID,childID,force=False):
        @rtype: boolean\r
        """\r
        windowClassName=winUser.getClassName(window)\r
-       # Generally, we must ignore focus on child windows of SDM windows as we only want the SDM MSAA events.
-       # However, we don't want to ignore focus if the child ID isn't 0,
+       # Generally, we must ignore focus on child windows of SDM windows as we only want the SDM MSAA events.\r
+       # However, we don't want to ignore focus if the child ID isn't 0,\r
        # as this is a child control and the SDM MSAA events don't handle child controls.\r
        if childID==0 and not windowClassName.startswith('bosa_sdm') and winUser.getClassName(winUser.getAncestor(window,winUser.GA_PARENT)).startswith('bosa_sdm'):\r
                return False\r
index a4932cc..061308e 100755 (executable)
@@ -40,18 +40,22 @@ HWND findRealMozillaWindow(HWND hwnd) {
        }\r
        wchar_t className[256];\r
        bool foundWindow=false;\r
+       HWND tempWindow=hwnd;\r
        do {\r
-               if(GetClassName(hwnd,className,256)==0) {\r
+               if(GetClassName(tempWindow,className,256)==0) {\r
                        DEBUG_MSG(L"Could not get class name for window "<<hwnd);\r
                        return hwnd;\r
                }\r
-               DEBUG_MSG(L"class name for window "<<hwnd<<L" is "<<className);\r
+               DEBUG_MSG(L"class name for window "<<tempWindow<<L" is "<<className);\r
                if(wcscmp(L"MozillaWindowClass",className)!=0) {\r
                        foundWindow=true;\r
                } else {\r
-                       hwnd=GetAncestor(hwnd,GA_PARENT);\r
+                       tempWindow=GetAncestor(tempWindow,GA_PARENT);\r
                }\r
-       } while(hwnd&&!foundWindow);\r
+       } while(tempWindow&&!foundWindow);\r
+       if(GetClassName(tempWindow,className,256)!=0&&wcsstr(className,L"Mozilla")==className) { \r
+               hwnd=tempWindow;\r
+       }\r
        DEBUG_MSG(L"Found window "<<hwnd);\r
        return hwnd;\r
 }\r
index c402376..148bf55 100644 (file)
@@ -448,9 +448,12 @@ the NVDAObject for IAccessible
                                windowHandle=IAccessibleObject.windowHandle\r
                        except COMError, e:\r
                                log.debugWarning("IAccessible2::windowHandle failed: %s" % e)\r
-                       #Mozilla Gecko: we can never use a MozillaWindowClass window\r
-                       while windowHandle and winUser.getClassName(windowHandle)=="MozillaWindowClass":\r
-                               windowHandle=winUser.getAncestor(windowHandle,winUser.GA_PARENT)\r
+                       #Mozilla Gecko: we can never use a MozillaWindowClass window for Gecko 1.9\r
+                       tempWindow=windowHandle\r
+                       while tempWindow and winUser.getClassName(tempWindow)=="MozillaWindowClass":\r
+                               tempWindow=winUser.getAncestor(tempWindow,winUser.GA_PARENT)\r
+                       if tempWindow and winUser.getClassName(tempWindow).startswith('Mozilla'):\r
+                               windowHandle=tempWindow\r
                try:\r
                        Identity=IAccessibleHandler.getIAccIdentity(IAccessibleObject,IAccessibleChildID)\r
                except:\r