mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge pull request #2050 from NguyenTranHoangSym/SDA-4427
SDA-4427: Add fix to case of close and capture with sym hidden
This commit is contained in:
commit
b16c6e4bbd
@ -187,7 +187,7 @@ class ScreenSnippet {
|
||||
hideOnCapture,
|
||||
);
|
||||
this.uploadSnippet(webContents, hideOnCapture);
|
||||
this.closeSnippet();
|
||||
this.closeSnippet(webContents);
|
||||
this.copyToClipboard();
|
||||
this.saveAs();
|
||||
return;
|
||||
@ -355,7 +355,6 @@ class ScreenSnippet {
|
||||
);
|
||||
webContents.send('screen-snippet-data', payload);
|
||||
winStore.restoreWindows(hideOnCapture);
|
||||
webContents.focus();
|
||||
await this.verifyAndUpdateAlwaysOnTop();
|
||||
} catch (error) {
|
||||
await this.verifyAndUpdateAlwaysOnTop();
|
||||
@ -363,6 +362,7 @@ class ScreenSnippet {
|
||||
`screen-snippet-handler: upload of screen capture failed with error: ${error}!`,
|
||||
);
|
||||
}
|
||||
webContents.focus();
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -370,7 +370,7 @@ class ScreenSnippet {
|
||||
/**
|
||||
* Close the current snippet
|
||||
*/
|
||||
private closeSnippet() {
|
||||
private closeSnippet(webContents: WebContents) {
|
||||
ipcMain.once(ScreenShotAnnotation.CLOSE, async (_event) => {
|
||||
try {
|
||||
windowHandler.closeSnippingToolWindow();
|
||||
@ -381,6 +381,8 @@ class ScreenSnippet {
|
||||
`screen-snippet-handler: close window failed with error: ${error}!`,
|
||||
);
|
||||
}
|
||||
|
||||
webContents?.focus();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -77,15 +77,17 @@ export class WindowStore {
|
||||
if (hideOnCapture) {
|
||||
this.restoreNotificationProperties();
|
||||
const storedWindows = this.getWindowStore();
|
||||
let currentWindow = storedWindows.windows.find(
|
||||
let _currentWindow = storedWindows.windows.find(
|
||||
(currentWindow) => currentWindow.focused,
|
||||
);
|
||||
if (!currentWindow) {
|
||||
if (!_currentWindow) {
|
||||
// In case there is no window focused, we automatically focus on the main one.
|
||||
currentWindow = storedWindows.windows.find(
|
||||
_currentWindow = storedWindows.windows.find(
|
||||
(currentWindow) => currentWindow.id === 'main',
|
||||
);
|
||||
currentWindow!.focused = true;
|
||||
if (_currentWindow) {
|
||||
_currentWindow!.focused = true;
|
||||
}
|
||||
}
|
||||
|
||||
let focusedWindowToRestore: ICustomBrowserWindow | undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user