Skip to content

UIA/ToastWin10/build 15063 and later: before announcing toasts, consult last toast message in case a repeat event was fired. re #7128#7376

Merged
michaelDCurran merged 3 commits into
nvaccess:masterfrom
josephsl:i7128repeatedToastMessages
Jul 25, 2017
Merged

Conversation

@josephsl

@josephsl josephsl commented Jul 11, 2017

Copy link
Copy Markdown
Contributor

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.

…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).
@josephsl josephsl requested a review from michaelDCurran July 11, 2017 04:06
@josephsl

Copy link
Copy Markdown
Contributor Author

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 michaelDCurran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@josephsl

josephsl commented Jul 11, 2017 via email

Copy link
Copy Markdown
Contributor Author

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).
Comment thread source/NVDAObjects/UIA/__init__.py Outdated
if sys.getwindowsversion().build >= 15063:
toastTimestamp = time.time()
toastRuntimeID = self.UIAElement.getRuntimeID()
if toastRuntimeID == self._lastToastRuntimeID and toastTimestamt-self._lastToastTimestamp < 1.0:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: toastTimestamt -> toastTimestamp

Caught by Mick Curran (NV Access): toastTimestamt -> toastTimestamp (thanks).
michaelDCurran added a commit that referenced this pull request Jul 12, 2017
@michaelDCurran michaelDCurran merged commit 4bde28c into nvaccess:master Jul 25, 2017
@nvaccessAuto nvaccessAuto added this to the 2017.3 milestone Jul 25, 2017
@josephsl josephsl deleted the i7128repeatedToastMessages branch July 19, 2020 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NVDA and notification text repeating multiple times

3 participants