Unable to edit information ... #1279: fixed focus issue - it electron bug of focus

This commit is contained in:
Pranav Ithape 2024-08-09 09:32:44 +05:30
parent d85ff01804
commit 3c3078dec0
5 changed files with 30903 additions and 3002 deletions

27990
desktop-app/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,12 @@
{
"name": "ResponsivelyApp",
"version": "1.10.0",
"version": "1.13.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ResponsivelyApp",
"version": "1.10.0",
"version": "1.13.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {

File diff suppressed because it is too large Load diff

View file

@ -177,6 +177,30 @@ const createWindow = async () => {
)}`
);
const isWindows = process.platform === 'win32';
let needsFocusFix = false;
let triggeringProgrammaticBlur = false;
mainWindow.on('blur', () => {
if (!triggeringProgrammaticBlur) {
needsFocusFix = true;
}
});
mainWindow.on('focus', () => {
if (isWindows && needsFocusFix) {
needsFocusFix = false;
triggeringProgrammaticBlur = true;
setTimeout(function () {
mainWindow!.blur();
mainWindow!.focus();
setTimeout(function () {
triggeringProgrammaticBlur = false;
}, 100);
}, 100);
}
});
mainWindow.on('ready-to-show', async () => {
await initInstance();
if (!mainWindow) {

File diff suppressed because it is too large Load diff