Skip to content

Commit

Permalink
Merge branch 't4841' into next: Fix reporting of the notification tha…
Browse files Browse the repository at this point in the history
…t appears when you click once on the Skype system tray icon.

Incubates #4841. Re #5405.
  • Loading branch information
jcsteh committed Nov 5, 2015
2 parents 1ce1750 + 098fc30 commit cf453a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
21 changes: 13 additions & 8 deletions source/appModules/skype.py
Expand Up @@ -170,23 +170,28 @@ class Notification(NVDAObjects.behaviors.Notification):

def _get_name(self):
startIndex = 0
if self.event_objectID == 99999:
# This is an event indicating an update.
if self.event_objectID is not None:
# This is for an event.
if self.windowHandle == self._lastWindow:
# Another notification is being added to an already visible window.
# Just report the added notification.
startIndex = self._lastChildCount
return " ".join(child.name for child in self.children[startIndex:])

def event_reorder(self):
self.event_alert()
def event_alert(self):
if self.name:
# There is new content.
super(Notification, self).event_alert()
Notification._lastWindow = self.windowHandle
Notification._lastChildCount = self.childCount

def event_show(self):
# Show gets fired when the window is created, but it isn't ready yet, so this isn't useful.
# We rely on reorder instead.
pass
# #5405: Some notifications (e.g. if you click once on the System Tray icon) only fire a show event.
# These are ready as soon as the event is fired.
event_show = event_alert
# #5405: Most notifications fire show, but aren't ready at this point.
# They then fire reorder when they're ready.
# #4841: They also fire reorder if another notification is later added to the same window.
event_reorder = event_alert

class TypingIndicator(NVDAObjects.IAccessible.IAccessible):

Expand Down
1 change: 1 addition & 0 deletions source/eventHandler.py
Expand Up @@ -237,6 +237,7 @@ def shouldAcceptEvent(eventName, windowHandle=None):
"Frame Notification Bar", # notification bars
"tooltips_class32", # tooltips
"mscandui21.candidate", "mscandui40.candidate", "MSCandUIWindow_Candidate", # IMM candidates
"TTrayAlert", # 5405: Skype
)
if eventName == "reorder":
# Prevent another flood risk.
Expand Down

0 comments on commit cf453a9

Please sign in to comment.