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) => { public restoreWindows = (hideOnCapture?: boolean) => {
if (hideOnCapture) { if (hideOnCapture) {
this.restoreNotificationProperties();
const storedWindows = this.getWindowStore(); const storedWindows = this.getWindowStore();
let currentWindow = storedWindows.windows.find( let currentWindow = storedWindows.windows.find(
(currentWindow) => currentWindow.focused, (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) => { private hideFullscreenWindow = (window: BrowserWindow) => {
window.once('leave-full-screen', () => { window.once('leave-full-screen', () => {
if (isMac) { if (isMac) {