SDA-4251 - Workaround to fix always on top issue (#1932)

Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com>
This commit is contained in:
Kiran Niranjan 2023-08-10 13:24:32 +05:30 committed by GitHub
parent 28650d9c5d
commit 59d02c7dd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -597,6 +597,20 @@ export class WindowHandler {
MAIN_WEB_CONTENTS_EVENTS,
this.mainWebContents,
);
// workaround for https://perzoinc.atlassian.net/browse/SDA-4251
this.mainWindow?.on('focus', () => {
const { alwaysOnTop } = config.getConfigFields(['alwaysOnTop']);
logger.info('window-handler: main window focused', alwaysOnTop);
if (
alwaysOnTop === CloudConfigDataTypes.ENABLED &&
this.mainWindow &&
windowExists(this.mainWindow)
) {
this.mainWindow.setAlwaysOnTop(false);
this.mainWindow.setAlwaysOnTop(true);
}
});
}
});