SDA-4206 Set alwaysOnTop and skipTaskbar post hiding main window

This commit is contained in:
sbenmoussati 2023-06-13 11:49:05 +02:00 committed by Salah Benmoussati
parent 5b3e9f87bb
commit b63b44bd0e

View File

@ -68,6 +68,7 @@ export class WindowStore {
public restoreWindows = (hideOnCapture?: boolean) => {
if (hideOnCapture) {
this.restoreNotificationProperties();
const storedWindows = this.getWindowStore();
let currentWindow = storedWindows.windows.find(
(currentWindow) => currentWindow.focused,
@ -132,6 +133,25 @@ export class WindowStore {
}
};
/**
* Restores notification properties reset to default post hiding main window
* @param windowsNames
*/
private restoreNotificationProperties = () => {
const windows = BrowserWindow.getAllWindows();
windows
.filter(
(window) =>
(window as ICustomBrowserWindow).winName ===
apiName.notificationWindowName,
)
.map((notificationWindow) => {
notificationWindow.setAlwaysOnTop(true);
notificationWindow.setSkipTaskbar(true);
});
};
private hideFullscreenWindow = (window: BrowserWindow) => {
window.once('leave-full-screen', () => {
if (isMac) {