diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index b4aaedd8..b4a764ca 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -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} + */ + 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) => { + 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} - */ - 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(); diff --git a/src/app/window-utils.ts b/src/app/window-utils.ts index a1d482f7..cfdcfed6 100644 --- a/src/app/window-utils.ts +++ b/src/app/window-utils.ts @@ -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