mirror of
https://github.com/finos/SymphonyElectron.git
synced 2026-10-25 06:17:38 -05:00
SDA-4710 & SDA-4940 Minimize the window if any pop-out windows exist (#2426)
* SDA-4710 - Minimize the window if any pop-out windows exist * chore - Bump windows os runner to window-2025
This commit is contained in:
1 parent
5fd13fb433
commit
2dda9ddf38
5 files changed
+21
-8
No files matched your search
@@ -9,7 +9,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x]
|
||||
os: [ubuntu-latest, windows-2019, macos-latest]
|
||||
os: [ubuntu-latest, windows-2025, macos-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -6,8 +6,8 @@ import { logger } from '../../common/logger';
|
||||
import { presenceStatus } from '../presence-status-handler';
|
||||
import { ICustomBrowserWindow, windowHandler } from '../window-handler';
|
||||
import {
|
||||
exitFullscreenAndHideWindow,
|
||||
getWindowByName,
|
||||
hideOrMinimizeFullscreenWindow,
|
||||
showBadgeCount,
|
||||
} from '../window-utils';
|
||||
|
||||
@@ -60,7 +60,7 @@ export class WindowStore {
|
||||
) {
|
||||
if (isMac) {
|
||||
if (isFullScreen) {
|
||||
hideOrMinimizeFullscreenWindow(currentWindow);
|
||||
exitFullscreenAndHideWindow(currentWindow);
|
||||
// No need to hide minimized windows
|
||||
} else if (!isMinimized) {
|
||||
currentWindow?.hide();
|
||||
|
||||
@@ -216,6 +216,9 @@ export const activate = (
|
||||
// Note: On window just focusing will preserve window snapped state
|
||||
// Hiding the window and just calling the focus() won't display the window
|
||||
if (isWindowsOS) {
|
||||
if (!window.isVisible()) {
|
||||
return window.show();
|
||||
}
|
||||
return window.isMinimized() ? window.restore() : window.focus();
|
||||
}
|
||||
|
||||
|
||||
@@ -70,11 +70,11 @@ import {
|
||||
import {
|
||||
createComponentWindow,
|
||||
didVerifyAndRestoreWindow,
|
||||
exitFullscreenAndHideWindow,
|
||||
getBounds,
|
||||
getWindowByName,
|
||||
handleCertificateProxyVerification,
|
||||
handleDownloadManager,
|
||||
hideOrMinimizeFullscreenWindow,
|
||||
initSysTray,
|
||||
injectStyles,
|
||||
isSymphonyReachable,
|
||||
@@ -803,11 +803,21 @@ export class WindowHandler {
|
||||
minimizeOnClose === CloudConfigDataTypes.ENABLED &&
|
||||
!this.isAutoUpdating
|
||||
) {
|
||||
const hasChildWindow =
|
||||
BrowserWindow.getAllWindows().filter(
|
||||
(window) =>
|
||||
(window as ICustomBrowserWindow).winName !==
|
||||
apiName.notificationWindowName &&
|
||||
(window as ICustomBrowserWindow).winName !==
|
||||
apiName.mainWindowName,
|
||||
).length > 0;
|
||||
logger.info(`window-handler: has child window?`, hasChildWindow);
|
||||
|
||||
event.preventDefault();
|
||||
if (this.mainWindow.isFullScreen()) {
|
||||
hideOrMinimizeFullscreenWindow(this.mainWindow);
|
||||
exitFullscreenAndHideWindow(this.mainWindow);
|
||||
} else {
|
||||
this.mainWindow.hide();
|
||||
hasChildWindow ? this.mainWindow.minimize() : this.mainWindow.hide();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -817,7 +827,7 @@ export class WindowHandler {
|
||||
// this is a workaround for an issue with macOS
|
||||
// https://github.com/electron/electron/issues/39572
|
||||
if (this.mainWindow.isFullScreen()) {
|
||||
hideOrMinimizeFullscreenWindow(this.mainWindow);
|
||||
exitFullscreenAndHideWindow(this.mainWindow);
|
||||
} else {
|
||||
this.mainWindow.hide();
|
||||
}
|
||||
|
||||
@@ -1609,7 +1609,7 @@ export const loadWebContentsView = async (
|
||||
return mainView.webContents;
|
||||
};
|
||||
|
||||
export const hideOrMinimizeFullscreenWindow = (window: BrowserWindow) => {
|
||||
export const exitFullscreenAndHideWindow = (window: BrowserWindow) => {
|
||||
window.once('leave-full-screen', () => {
|
||||
if (!window && !windowExists(window)) {
|
||||
logger.info('window-utils: window does not exists');
|
||||
|
||||
Reference in new issue
Block a user