• R/O
  • HTTP
  • SSH
  • HTTPS

nvdajp: コミット

NVDA with Japanese branch


コミットメタ情報

リビジョン791d8b92064a5130cafc30bb99ac75f712816e59 (tree)
日時2010-10-28 15:02:35
作者James Teh <jamie@jant...>
コミッターJames Teh

ログメッセージ

Fix access to some Windows Security dialogs such as the dialog that appears when installing unsigned drivers.
It seems that custom window messages cannot be sent to these dialogs, so sending our custom ping message returns an access denied error, which causes IAccessibleHandler.accessibleObjectFromEvent() to fail.
This custom ping message was implemented to fix Windows Live Messenger 2009 exiting on startup (#677). Instead, just use WM_NULL (which can be sent to these dialogs) and implement a specific condition to ignore the problematic event from Messenger.

変更サマリ

差分

--- a/source/IAccessibleHandler.py
+++ b/source/IAccessibleHandler.py
@@ -358,7 +358,7 @@ def normalizeIAccessible(pacc):
358358
359359 def accessibleObjectFromEvent(window,objectID,childID):
360360 wmResult=c_long()
361- if windll.user32.SendMessageTimeoutW(window,wmNVDAPing,0,0,winUser.SMTO_ABORTIFHUNG,2000,byref(wmResult))==0:
361+ if windll.user32.SendMessageTimeoutW(window,winUser.WM_NULL,0,0,winUser.SMTO_ABORTIFHUNG,2000,byref(wmResult))==0:
362362 log.debugWarning("Window %d dead or not responding: %s" % (window, ctypes.WinError()))
363363 return None
364364 try:
@@ -577,6 +577,11 @@ def winEventCallback(handle,eventID,window,objectID,childID,threadID,timestamp):
577577 #We never want to see foreground events for the Program Manager or Shell (task bar)
578578 if eventID==winUser.EVENT_SYSTEM_FOREGROUND and windowClassName in ("Progman","Shell_TrayWnd"):
579579 return
580+ if eventID==winUser.EVENT_OBJECT_NAMECHANGE and windowClassName=="MSNHiddenWindowClass":
581+ # HACK: This gets fired by Windows Live Messenger 2009 when it starts.
582+ # If we send a WM_NULL to this window at this point (which happens in accessibleObjectFromEvent), Messenger will silently exit (#677).
583+ # Therefore, completely ignore the event, which is useless to us anyway.
584+ return
580585 winEventLimiter.addEvent(eventID,window,objectID,childID,threadID)
581586 except:
582587 log.error("winEventCallback", exc_info=True)
@@ -801,13 +806,7 @@ def _fakeFocus(oldFocus):
801806 #Register internal object event with IAccessible
802807 cWinEventCallback=WINFUNCTYPE(None,c_int,c_int,c_int,c_int,c_int,c_int,c_int)(winEventCallback)
803808
804-#: A window message used to determine whether a window is alive.
805-#: We use this instead of WM_NULL because Windows Live Messenger 2009 (and maybe other applications) barf if we send WM_NULL.
806-wmNVDAPing = None
807809 def initialize():
808- global wmNVDAPing
809- if not wmNVDAPing:
810- wmNVDAPing = windll.user32.RegisterWindowMessageW(u"NVDA ping")
811810 for eventType in winEventIDsToNVDAEventNames.keys():
812811 hookID=winUser.setWinEventHook(eventType,eventType,0,cWinEventCallback,0,0,0)
813812 if hookID:
旧リポジトリブラウザで表示