diff --git a/electron/main.ts b/electron/main.ts index ea51c2a83..21f95cd00 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -1,4 +1,4 @@ -import { app, BrowserWindow, globalShortcut, Menu, Tray } from 'electron' +import { app, BrowserWindow, Menu, Tray } from 'electron' import { join } from 'path' /** @@ -106,9 +106,6 @@ function createMainWindow() { } function registerGlobalShortcuts() { - // TODO: Toggle below line when build production - // const ret = globalShortcut.register(quickAskHotKey, () => { - // const selectedText = '' const ret = registerShortcut(quickAskHotKey, (selectedText: string) => { if (!windowManager.isQuickAskWindowVisible()) { windowManager.showQuickAskWindow() diff --git a/electron/managers/quickAskWindowConfig.ts b/electron/managers/quickAskWindowConfig.ts index 4a5ce1e5d..eb30e8ebc 100644 --- a/electron/managers/quickAskWindowConfig.ts +++ b/electron/managers/quickAskWindowConfig.ts @@ -6,7 +6,16 @@ export const quickAskWindowConfig: Electron.BrowserWindowConstructorOptions = { width: DEFAULT_WIDTH, height: DEFAULT_HEIGHT, skipTaskbar: true, + acceptFirstMouse: true, + hasShadow: true, + alwaysOnTop: true, + show: false, + fullscreenable: false, resizable: false, + center: true, + movable: false, + maximizable: false, + focusable: true, transparent: true, frame: false, type: 'panel', diff --git a/electron/managers/window.ts b/electron/managers/window.ts index 5a5254bc8..796a5d54a 100644 --- a/electron/managers/window.ts +++ b/electron/managers/window.ts @@ -64,7 +64,6 @@ class WindowManager { this._quickAskWindow.on('blur', () => { this.hideQuickAskWindow() }) - this.hideQuickAskWindow() } isMainWindowVisible(): boolean { diff --git a/web/app/search/UserInput.tsx b/web/app/search/UserInput.tsx index a5fbfc682..3bf148f40 100644 --- a/web/app/search/UserInput.tsx +++ b/web/app/search/UserInput.tsx @@ -18,10 +18,10 @@ const UserInput: React.FC = () => { const selectedText = useAtomValue(selectedTextAtom) useEffect(() => { - if (inputRef.current) { - inputRef.current.focus() - } + inputRef.current?.focus() + }) + useEffect(() => { const onKeyDown = (e: KeyboardEvent) => { if (e.key === 'Escape') { window.core?.api?.hideQuickAskWindow()