-
-
Notifications
You must be signed in to change notification settings - Fork 822
Windows 10 Mail: ensure browse mode is used in the reading pane. #12320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,13 +12,32 @@ | |
|
|
||
| class MailWordDocumentTreeInterceptor(WordDocument.treeInterceptorClass): | ||
|
|
||
| def _get_isAlive(self): | ||
| return super(MailWordDocumentTreeInterceptor,self).isAlive and self.rootNVDAObject.shouldCreateTreeInterceptor | ||
| _wasInReadingPane: bool = False | ||
|
|
||
| def event_treeInterceptor_gainFocus(self): | ||
| isInReadingPane = self.rootNVDAObject.isInReadingPane | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This assumes that This took me quite some time to determine, typing would help, maybe something like this at class level: rootNVDAObject: MailWordDocument
def __init__(self, obj:MailWordDocument):
if not isinstance(obj, MailWordDocument):
log.error("MailWordDocumentTreeInterceptor depends on rootNVDAObject being a MailWordDocument see event_treeInterceptor_gainFocus")
super().__init(obj) |
||
| if isInReadingPane != self._wasInReadingPane: | ||
| self._wasInReadingPane = isInReadingPane | ||
| # The base WordDocument TreeInterceptorClass forces focus mode by default | ||
| # As a TreeInterceptor is created for all word documents | ||
| # so that the NVDA elements list is available. | ||
| # However, Windows 10 Mail's reading pane should use browse mode. | ||
| if isInReadingPane: | ||
| self.disableAutoPassThrough = False | ||
| self.passThrough = False | ||
| else: | ||
| self.disableAutoPassThrough = True | ||
| self.passThrough = True | ||
| super().event_treeInterceptor_gainFocus() | ||
|
|
||
| class MailWordDocument(WordDocument): | ||
|
|
||
| treeInterceptorClass=MailWordDocumentTreeInterceptor | ||
| def _get_shouldCreateTreeInterceptor(self): | ||
|
|
||
| # typing information for isInReadingPane property | ||
| isInReadingPane: bool | ||
|
|
||
| def _get_isInReadingPane(self) -> bool: | ||
| # Locate the Reading pane in the ancestors | ||
| condition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_ClassNamePropertyId,"ReadingPaneModern") | ||
| walker=UIAHandler.handler.clientObject.createTreeWalker(condition) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be initialized to False? Currently this will only be accurate after the gain focus event is fired the first time. Could this be initialized correctly in the
__init__method instead.Could a situation arise where the object is created while focus is already in a readingpane? Thus no initial fire of the gainfocus to set this to True, but rendering it inaccurate?