In this change, we update the application to support the FlashWindow feature on Windows. When the Google Voice notification count goes up and the main application window doesn't have focus, it will now flash on the Taskbar to get the user's attention.
BUG FIX: Prevent Dock bounce on Mac when notification count decreases
I'm fixing this because I believe it's a bug. But if someone lets me know that this assumption was incorrect, this can easily be reverted. Today (on MacOS), the application will tell its Dock icon to bounce anytime the notification count changes to a non-zero value. I believe this should actually only happen if the count goes up. If you read a notification in an external browser window, you probably don't want your Dock icon to bounce because of it.
if (newCount > oldCount) {
app.dock.bounce();
}
Function name tweak/cleanup
I renamed the following functions:
sendCountsToDock()
sendCountsToDockMac()
sendCountsToDockWindows()
To the following new names, respectively:
processNotificationCount()
processNotificationCount_MacOS()
processNotificationCount_Windows()
The "Dock" is only applicable to MacOS, so I tweaked the names of these functions for clarity. I also added documentation to help everyone who isn't familiar with what's going on for every OS.
How Tested?
Tested on Windows.
Verified that Taskbar button doesn't flash on initial application launch.
Verified that Taskbar button flashes when main window is open and notification count increases.
Verified that Taskbar colour (flash) goes away once window is clicked on again by user.
Verified that application continues to work when notifications come in while main window is hidden.
Changes
Taskbar Flashing
In this change, we update the application to support the FlashWindow feature on Windows. When the Google Voice notification count goes up and the main application window doesn't have focus, it will now flash on the Taskbar to get the user's attention.
BUG FIX: Prevent Dock bounce on Mac when notification count decreases
I'm fixing this because I believe it's a bug. But if someone lets me know that this assumption was incorrect, this can easily be reverted. Today (on MacOS), the application will tell its Dock icon to bounce anytime the notification count changes to a non-zero value. I believe this should actually only happen if the count goes up. If you read a notification in an external browser window, you probably don't want your Dock icon to bounce because of it.
Function name tweak/cleanup
I renamed the following functions:
sendCountsToDock()
sendCountsToDockMac()
sendCountsToDockWindows()
To the following new names, respectively:
processNotificationCount()
processNotificationCount_MacOS()
processNotificationCount_Windows()
The "Dock" is only applicable to MacOS, so I tweaked the names of these functions for clarity. I also added documentation to help everyone who isn't familiar with what's going on for every OS.
How Tested?