Skip to content

Commit

Permalink
enable flashFrame usage on linux (#1683)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Meridian <[email protected]>
  • Loading branch information
alexcarson440 authored May 20, 2024
1 parent ad31cea commit c49f7e6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ ipcMain.on("setBadgeCount", function (_ev: IpcMainEvent, count: number): void {

let focusHandlerAttached = false;
ipcMain.on("loudNotification", function (): void {
if (process.platform === "win32" && global.mainWindow && !global.mainWindow.isFocused() && !focusHandlerAttached) {
global.mainWindow.flashFrame(true);
global.mainWindow.once("focus", () => {
global.mainWindow?.flashFrame(false);
focusHandlerAttached = false;
});
focusHandlerAttached = true;
if (process.platform === "win32" || process.platform === "linux") {
if (global.mainWindow && !global.mainWindow.isFocused() && !focusHandlerAttached) {
global.mainWindow.flashFrame(true);
global.mainWindow.once("focus", () => {
global.mainWindow?.flashFrame(false);
focusHandlerAttached = false;
});
focusHandlerAttached = true;
}
}
});

Expand Down

0 comments on commit c49f7e6

Please sign in to comment.