From c9a1a98eac72152d4bb8cc09bae0243bff3998bc Mon Sep 17 00:00:00 2001 From: Nicolas Bonamy Date: Thu, 12 Dec 2024 18:01:20 -0600 Subject: [PATCH] prompt focus fixes --- build/build_number.txt | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/automations/anywhere.ts | 2 +- src/main/windows/anywhere.ts | 7 ++++++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build/build_number.txt b/build/build_number.txt index 408b885..bf7aeeb 100644 --- a/build/build_number.txt +++ b/build/build_number.txt @@ -1 +1 @@ -461 +462 diff --git a/package-lock.json b/package-lock.json index b2f19e2..f248074 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "witsy", - "version": "1.27.2", + "version": "1.27.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "witsy", - "version": "1.27.2", + "version": "1.27.3", "license": "Apache-2.0", "dependencies": { "@el3um4s/run-vbs": "^1.1.2", diff --git a/package.json b/package.json index 429059d..ea7db19 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "witsy", "productName": "Witsy", - "version": "1.27.2", + "version": "1.27.3", "description": "Witsy: desktop AI assistant", "repository": { "type": "git", diff --git a/src/automations/anywhere.ts b/src/automations/anywhere.ts index dc0bf12..7e21cbd 100644 --- a/src/automations/anywhere.ts +++ b/src/automations/anywhere.ts @@ -25,7 +25,7 @@ export default class PromptAnywhere { // close await window.closePromptAnywhere(); await window.restoreWindows(); - //await window.releaseFocus(); + await window.releaseFocus(); } diff --git a/src/main/windows/anywhere.ts b/src/main/windows/anywhere.ts index 8d143d5..f57f69f 100644 --- a/src/main/windows/anywhere.ts +++ b/src/main/windows/anywhere.ts @@ -1,6 +1,6 @@ import { strDict } from 'types/index.d'; -import { BrowserWindow } from 'electron'; +import { app, BrowserWindow } from 'electron'; import { createWindow, getCurrentScreen, getCenteredCoordinates } from './index'; export let promptAnywhereWindow: BrowserWindow = null; @@ -30,6 +30,11 @@ export const preparePromptAnywhere = (): BrowserWindow => { movable: true, }); + promptAnywhereWindow.on('show', () => { + app.focus({ steal: true }); + promptAnywhereWindow.focusOnWebView(); + }); + // done return promptAnywhereWindow;