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:
Johan Kwarnmark 2020-03-03 11:34:15 +01:00 committed by GitHub
commit 402665f470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 22 deletions

View File

@ -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();

View File

@ -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