UIA/ToastWin10/build 15063 and later: before announcing toasts, consult last toast message in case a repeat event was fired. re #7128#7376
Conversation
…lt last toast message to make sure it is different, caused by possible problem in uIA Core in Creators Update and later. re nvaccess#7128. According to mick Curran (NV Access), UIA Core may have bugs when it comes to firing multiple toast events after using UWP's for a while, so detect this by consulting last toast message if the build is 15063 or later. This does not affect older releases such as Anniversary Update (build 14393).
|
Hi, This pull request was tested on Windows 10 builds 10586, 14393, 15063 and 16232 and passes the test (tests involved plugging a USB flash drive and seeing if NVDA repeats auto-play messages). Thanks. |
michaelDCurran
left a comment
There was a problem hiding this comment.
I would prefer to store the time and the UIAElement's runtimeID, rather than the name. Only allow the event if the runtimeIDs do not match or the time is greater than a second. These duplicate windowOpen events happen extremely fast, but just not fast enough to catch duplicates in one core cycle. We still want to allow duplicate events that are far away from each other as it is reasonable to think that Windows may show duplicate notifications deliberately, which the user should know about.
|
Hi, at least in build 16232, toasts have the same runtime ID, so both conditions must be inverted (leave the event if ID’s match and timestamp is less than a second). Modification on its way. Thanks.
From: Michael Curran [mailto:notifications@github.com]
Sent: Monday, July 10, 2017 11:11 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Joseph Lee <joseph.lee22590@gmail.com>; Author <author@noreply.github.com>
Subject: Re: [nvaccess/nvda] UIA/ToastWin10/build 15063 and later: before announcing toasts, consult last toast message in case a repeat event was fired. re #7128 (#7376)
@michaelDCurran requested changes on this pull request.
I would prefer to store the time and the UIAElement's runtimeID, rather than the name. Only allow the event if the runtimeIDs do not match or the time is greater than a second. These duplicate windowOpen events happen extremely fast, but just not fast enough to catch duplicates in one core cycle. We still want to allow duplicate events that are far away from each other as it is reasonable to think that Windows may show duplicate notifications deliberately, which the user should know about.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#7376 (review)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkAkustZHMLojRXfaMN-JLMnHGxrLks5sMxILgaJpZM4OTs8J> .
|
Reviewed by Mick Curran (NV Access): check runtime ID and timestamp instead of name alone. However, in latest Windows Insider build (1623x), toasts have same runtime ID, so both this and timestamp must be checked (leave the event if runtime ID's are the same and timestamps are less than a second apart).
| if sys.getwindowsversion().build >= 15063: | ||
| toastTimestamp = time.time() | ||
| toastRuntimeID = self.UIAElement.getRuntimeID() | ||
| if toastRuntimeID == self._lastToastRuntimeID and toastTimestamt-self._lastToastTimestamp < 1.0: |
There was a problem hiding this comment.
Typo: toastTimestamt -> toastTimestamp
Caught by Mick Curran (NV Access): toastTimestamt -> toastTimestamp (thanks).
Fixes #7128: NVDA repeats toast messages if UWP's were used for a while. Noted by @michaelDCurran as caused by possible issue with UIA Core in build 15063 and later. The issue is specific to Creators Update and later.
Suggested what's new entry:
Section: bug fixes
In Windows 10 Creators Update, NVDA will no longer announce toasts multiple times.
Thanks.