diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-13 09:07:33 +0530 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-13 07:32:56 +0000 |
commit | b2eef1daaa41313257e3f439d4d5604314c9ae2c (patch) | |
tree | 5fc0d7ff2d9c94d783ad166307f9e550a34086a2 /src/electron/ipc-api/focusState.js | |
parent | chore: Replace old '@meetfranz/electron-notification-state' with 'macos-notif... (diff) | |
download | ferdium-app-b2eef1daaa41313257e3f439d4d5604314c9ae2c.tar.gz ferdium-app-b2eef1daaa41313257e3f439d4d5604314c9ae2c.tar.zst ferdium-app-b2eef1daaa41313257e3f439d4d5604314c9ae2c.zip |
fix(App): Fix app focus detection
Diffstat (limited to 'src/electron/ipc-api/focusState.js')
-rw-r--r-- | src/electron/ipc-api/focusState.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/electron/ipc-api/focusState.js b/src/electron/ipc-api/focusState.js new file mode 100644 index 000000000..0b4a0d8f3 --- /dev/null +++ b/src/electron/ipc-api/focusState.js | |||
@@ -0,0 +1,9 @@ | |||
1 | export default (params) => { | ||
2 | params.mainWindow.on('focus', () => { | ||
3 | params.mainWindow.webContents.send('isWindowFocused', true); | ||
4 | }); | ||
5 | |||
6 | params.mainWindow.on('blur', () => { | ||
7 | params.mainWindow.webContents.send('isWindowFocused', false); | ||
8 | }); | ||
9 | }; | ||