From e35c80f0ecad9250598d78db293b2622298558f9 Mon Sep 17 00:00:00 2001 From: sbenmoussati Date: Mon, 5 Jun 2023 14:45:49 +0200 Subject: [PATCH] SDA-4204 Show only visible windows to prevent showing back hidden toast notifications while taking a screenshot --- src/app/screen-snippet-handler.ts | 3 +++ src/app/stores/window-store.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/screen-snippet-handler.ts b/src/app/screen-snippet-handler.ts index 2e403b5c..07baab8c 100644 --- a/src/app/screen-snippet-handler.ts +++ b/src/app/screen-snippet-handler.ts @@ -474,6 +474,7 @@ class ScreenSnippet { focused: mainWindow?.isFocused(), minimized: mainWindow?.isMinimized(), isFullScreen: mainWindow?.isFullScreen(), + isVisible: mainWindow?.isVisible(), }, ]; @@ -487,6 +488,7 @@ class ScreenSnippet { focused: window.isFocused(), minimized: window?.isMinimized(), isFullScreen: window?.isFullScreen(), + isVisible: window?.isVisible(), }); } }); @@ -497,6 +499,7 @@ class ScreenSnippet { focused: currentWindowObj?.isFocused(), minimized: currentWindowObj?.isMinimized(), isFullScreen: currentWindowObj?.isFullScreen(), + isVisible: currentWindowObj?.isVisible(), }); windowsArr = mainArr.concat(windowsArr); } else { diff --git a/src/app/stores/window-store.ts b/src/app/stores/window-store.ts index 754a5de5..42c74692 100644 --- a/src/app/stores/window-store.ts +++ b/src/app/stores/window-store.ts @@ -15,6 +15,7 @@ export interface IWindowState { minimized?: boolean; focused?: boolean; isFullScreen?: boolean; + isVisible?: boolean; } export class WindowStore { @@ -77,7 +78,7 @@ export class WindowStore { const fullscreenedWindows: IWindowState[] = []; // Restoring all windows except focused one storedWindows.windows.forEach((currentWindow) => { - if (currentWindow) { + if (currentWindow && currentWindow.isVisible) { const window: ICustomBrowserWindow | undefined = getWindowByName( currentWindow.id || '', ) as ICustomBrowserWindow;