mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -06:00
Merge pull request #882 from johankwarnmarksymphony/sda-1717
fix: SDA-1717: Screen sharing indicator is not removed when SDA is reloaded
This commit is contained in:
commit
402665f470
@ -72,6 +72,7 @@ export class WindowHandler {
|
||||
public spellchecker: SpellChecker | undefined;
|
||||
public isCustomTitleBar: boolean;
|
||||
public isWebPageLoading: boolean = true;
|
||||
public screenShareIndicatorFrameUtil: string;
|
||||
|
||||
private readonly contextIsolation: boolean;
|
||||
private readonly backgroundThrottling: boolean;
|
||||
@ -89,7 +90,6 @@ export class WindowHandler {
|
||||
private screenSharingFrameWindow: Electron.BrowserWindow | null = null;
|
||||
private basicAuthWindow: Electron.BrowserWindow | null = null;
|
||||
private notificationSettingsWindow: Electron.BrowserWindow | null = null;
|
||||
private screenShareIndicatorFrameUtil: string;
|
||||
|
||||
constructor(opts?: Electron.BrowserViewConstructorOptions) {
|
||||
// Use these variables only on initial setup
|
||||
@ -917,6 +917,28 @@ export class WindowHandler {
|
||||
delete this.windows[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given command via a child process
|
||||
*
|
||||
* @param util {string}
|
||||
* @param utilArgs {ReadonlyArray<string>}
|
||||
*/
|
||||
public execCmd(util: string, utilArgs: ReadonlyArray<string>): Promise<ChildProcess> {
|
||||
logger.info(`window handler: execCmd: util: ${util} utilArgs: ${utilArgs}`);
|
||||
return new Promise<ChildProcess>((resolve, reject) => {
|
||||
return execFile(util, utilArgs, (error: ExecException | null) => {
|
||||
if (error) {
|
||||
logger.info(`window handler: execCmd: error: ${error}`);
|
||||
}
|
||||
if (error && error.killed) {
|
||||
// processs was killed, just resolve with no data.
|
||||
return reject(error);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the about panel details for macOS
|
||||
*/
|
||||
@ -1046,27 +1068,6 @@ export class WindowHandler {
|
||||
|
||||
return {...defaultWindowOpts, ...windowOpts};
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given command via a child process
|
||||
*
|
||||
* @param util {string}
|
||||
* @param utilArgs {ReadonlyArray<string>}
|
||||
*/
|
||||
private execCmd(util: string, utilArgs: ReadonlyArray<string>): Promise<ChildProcess> {
|
||||
logger.info(`window handler: execCmd: util: ${util} utilArgs: ${utilArgs}`);
|
||||
return new Promise<ChildProcess>((resolve, reject) => {
|
||||
return execFile(util, utilArgs, (error: ExecException | null) => {
|
||||
logger.info(`window handler: execCmd: error: ${error}`);
|
||||
if (error && error.killed) {
|
||||
// processs was killed, just resolve with no data.
|
||||
return reject(error);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const windowHandler = new WindowHandler();
|
||||
|
@ -547,6 +547,9 @@ export const reloadWindow = (browserWindow: ICustomBrowserWindow) => {
|
||||
if (windowName === apiName.mainWindowName) {
|
||||
logger.info(`window-utils: reloading the main window`);
|
||||
browserWindow.reload();
|
||||
|
||||
windowHandler.execCmd(windowHandler.screenShareIndicatorFrameUtil, []);
|
||||
|
||||
return;
|
||||
}
|
||||
// Send an event to SFE that restarts the pop-out window
|
||||
|
Loading…
Reference in New Issue
Block a user