Skip to content

Commit

Permalink
prompt focus fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nbonamy committed Dec 13, 2024
1 parent 09f910b commit c9a1a98
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/build_number.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
461
462
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "witsy",
"productName": "Witsy",
"version": "1.27.2",
"version": "1.27.3",
"description": "Witsy: desktop AI assistant",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/automations/anywhere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class PromptAnywhere {
// close
await window.closePromptAnywhere();
await window.restoreWindows();
//await window.releaseFocus();
await window.releaseFocus();

}

Expand Down
7 changes: 6 additions & 1 deletion src/main/windows/anywhere.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -30,6 +30,11 @@ export const preparePromptAnywhere = (): BrowserWindow => {
movable: true,
});

promptAnywhereWindow.on('show', () => {
app.focus({ steal: true });
promptAnywhereWindow.focusOnWebView();
});

// done
return promptAnywhereWindow;

Expand Down

0 comments on commit c9a1a98

Please sign in to comment.