From 8b251a3cca164981cce208b0979e394d76cd82f4 Mon Sep 17 00:00:00 2001 From: Johan Kwarnmark Date: Mon, 2 Mar 2020 14:36:53 +0100 Subject: [PATCH 1/3] sda-1717 made screenShareIndicatorFrameUtil and execCmd public --- src/app/window-handler.ts | 43 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index 32feebe9..c71b975d 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -75,6 +75,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; @@ -92,7 +93,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 @@ -918,6 +918,26 @@ export class WindowHandler { delete this.windows[key]; } + /** + * Executes the given command via a child process + * + * @param util {string} + * @param utilArgs {ReadonlyArray} + */ + public execCmd(util: string, utilArgs: ReadonlyArray): Promise { + logger.info(`window handler: execCmd: util: ${util} utilArgs: ${utilArgs}`); + return new Promise((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(); + }); + }); + } + /** * Sets the about panel details for macOS */ @@ -1046,27 +1066,6 @@ export class WindowHandler { return {...defaultWindowOpts, ...windowOpts}; } - - /** - * Executes the given command via a child process - * - * @param util {string} - * @param utilArgs {ReadonlyArray} - */ - private execCmd(util: string, utilArgs: ReadonlyArray): Promise { - logger.info(`window handler: execCmd: util: ${util} utilArgs: ${utilArgs}`); - return new Promise((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(); From 6a821548181a06117b99a70288acdfcba6a3add7 Mon Sep 17 00:00:00 2001 From: Johan Kwarnmark Date: Mon, 2 Mar 2020 14:37:47 +0100 Subject: [PATCH 2/3] sda-1717 when application is reloading all childwindows are closed, added kill of screen share frame --- src/app/window-utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/window-utils.ts b/src/app/window-utils.ts index 112bf167..5e95e97d 100644 --- a/src/app/window-utils.ts +++ b/src/app/window-utils.ts @@ -543,6 +543,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 From 890268f9d8f0915833b5cb9f5f3121e5bb7bab14 Mon Sep 17 00:00:00 2001 From: Johan Kwarnmark <55975938+johankwarnmarksymphony@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:46:49 +0100 Subject: [PATCH 3/3] Update src/app/window-handler.ts Co-Authored-By: mattias-symphony <57355424+mattias-symphony@users.noreply.github.com> --- src/app/window-handler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index c71b975d..7a9166f1 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -928,7 +928,9 @@ export class WindowHandler { logger.info(`window handler: execCmd: util: ${util} utilArgs: ${utilArgs}`); return new Promise((resolve, reject) => { return execFile(util, utilArgs, (error: ExecException | null) => { - logger.info(`window handler: execCmd: error: ${error}`); + if (error) { + logger.info(`window handler: execCmd: error: ${error}`); + } if (error && error.killed) { // processs was killed, just resolve with no data. return reject(error);