Skip to content

Commit

Permalink
chore: fix the annoying dock bounce on macOS (WPB-14749) (#8392)
Browse files Browse the repository at this point in the history
* chore: fix the annoying dock bounce on macOS

* chore: fix linting issue

* chore: fix oopsie

* fix lint issue

---------

Co-authored-by: Amir Ghezelbash <[email protected]>
  • Loading branch information
emil-wire and thisisamir98 authored Dec 4, 2024
1 parent 20496a2 commit 9306cd0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion electron/src/menu/TrayHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ export class TrayHandler {
if (win.isFocused() || !count) {
win.flashFrame(false);
} else if (count > this.lastUnreadCount) {
win.flashFrame(true);
/* After an Electron API change https://github.com/electron/electron/pull/41391
flashFrame() leads to a constant bouncing of the dock icon on macOS.
By calling the dock.bounce() directly, we avoid this behavior. the "informational"
is optional (default), but makes it easier to read
*/
if (process.platform === 'darwin') {
app.dock.bounce('informational');
} else {
win.flashFrame(true);
}
}
}

Expand Down

0 comments on commit 9306cd0

Please sign in to comment.