From 8939e086ef688b02c5848dedc25696080f7ad68d Mon Sep 17 00:00:00 2001 From: Qing Date: Sat, 15 Oct 2022 23:03:01 +0800 Subject: [PATCH] frontend: fix alt+tab --- lama_cleaner/app/src/components/Editor/Editor.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lama_cleaner/app/src/components/Editor/Editor.tsx b/lama_cleaner/app/src/components/Editor/Editor.tsx index ce79e7c..9555cf1 100644 --- a/lama_cleaner/app/src/components/Editor/Editor.tsx +++ b/lama_cleaner/app/src/components/Editor/Editor.tsx @@ -462,6 +462,17 @@ export default function Editor() { } }, [windowSize, resetZoom]) + useEffect(() => { + window.addEventListener('blur', () => { + setIsChangingBrushSizeByMouse(false) + }) + return () => { + window.removeEventListener('blur', () => { + setIsChangingBrushSizeByMouse(false) + }) + } + }, []) + const handleEscPressed = () => { if (isInpainting) { return