Skip to content

Commit 8bf5d5e

Browse files
committed
fix: hide launcher on blur
1 parent 8826f80 commit 8bf5d5e

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

electron/windows/controller.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export const createWindowController = ({
157157
launcherWindow.on("closed", () => {
158158
launcherWindow = null;
159159
});
160+
launcherWindow.on("blur", handleLauncherBlur);
160161

161162
launcherWindow.webContents.on("did-finish-load", () => {
162163
launcherWindow?.webContents.send(
@@ -252,6 +253,18 @@ export const createWindowController = ({
252253
isRingVisible = false;
253254
};
254255

256+
/**
257+
* Request the launcher to close when it loses focus.
258+
*/
259+
const handleLauncherBlur = () => {
260+
if (!isRingVisible) {
261+
return;
262+
}
263+
264+
isRingAnimating = true;
265+
requestRingClose();
266+
};
267+
255268
/**
256269
* Toggle the ring visibility.
257270
*/

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "round-drop",
33
"private": true,
4-
"version": "1.6.0",
4+
"version": "1.6.2",
55
"author": {
66
"name": "nekobato",
77
"email": "nekobato@gmail.com",

0 commit comments

Comments
 (0)