SDA-3871 Closing screensharing frame and screen picker window after the end of a meeting (#1501)

This commit is contained in:
Salah Benmoussati 2022-09-23 11:22:57 +02:00 committed by GitHub
parent 52cae21865
commit fc75ac60a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 10 deletions

View File

@ -248,6 +248,10 @@ ipcMain.on(
if (typeof arg.isInMeeting === 'boolean') {
memoryMonitor.setMeetingStatus(arg.isInMeeting);
appStateHandler.preventDisplaySleep(arg.isInMeeting);
if (!arg.isInMeeting) {
windowHandler.closeScreenPickerWindow();
windowHandler.closeScreenSharingIndicator();
}
}
break;
case apiCmds.memoryInfo:

View File

@ -652,7 +652,7 @@ export class WindowHandler {
`window-handler: main window closed, destroying all windows!`,
);
if (isWindowsOS || isMac) {
this.execCmd(this.screenShareIndicatorFrameUtil, []);
this.closeScreenSharingIndicator();
}
this.closeAllWindows();
this.destroyAllWindows();
@ -921,10 +921,7 @@ export class WindowHandler {
}
if (isWindowsOS || isMac) {
const timeoutValue = 300;
setTimeout(
() => this.execCmd(this.screenShareIndicatorFrameUtil, []),
timeoutValue,
);
setTimeout(() => this.closeScreenSharingIndicator(), timeoutValue);
} else {
if (
this.screenSharingFrameWindow &&
@ -1449,7 +1446,7 @@ export class WindowHandler {
if (source != null) {
logger.info(`window-handler: screen-source-select`, source, id);
this.execCmd(this.screenShareIndicatorFrameUtil, []);
this.closeScreenSharingIndicator();
const timeoutValue = 300;
setTimeout(() => {
this.drawScreenShareIndicatorFrame(source);
@ -1470,7 +1467,7 @@ export class WindowHandler {
ipcMain.once('screen-source-selected', (_event, source) => {
logger.info(`window-handler: screen-source-selected`, source, id);
if (source == null) {
this.execCmd(this.screenShareIndicatorFrameUtil, []);
this.closeScreenSharingIndicator();
if (
this.screenPickerPlaceholderWindow &&
windowExists(this.screenPickerPlaceholderWindow)
@ -1519,6 +1516,24 @@ export class WindowHandler {
});
}
/**
* Closes a screen picker window if it exists
*
*/
public closeScreenPickerWindow() {
if (this.screenPickerWindow && windowExists(this.screenPickerWindow)) {
this.screenPickerWindow.close();
}
}
/**
* Closes screen sharing indicator
*
*/
public async closeScreenSharingIndicator() {
this.execCmd(this.screenShareIndicatorFrameUtil, []);
}
/**
* Creates a Basic auth window whenever the network
* requires authentications
@ -2092,7 +2107,7 @@ export class WindowHandler {
default:
this.url = this.globalConfig.url + `?x-km-csrf-token=${csrfToken}`;
}
await this.execCmd(this.screenShareIndicatorFrameUtil, []);
await this.closeScreenSharingIndicator();
const userAgent = this.getUserAgent(this.mainWebContents);
await this.mainWebContents.loadURL(this.url, { userAgent });
} catch (e) {

View File

@ -154,7 +154,7 @@ export const preventWindowNavigation = (
}
}
windowHandler.execCmd(windowHandler.screenShareIndicatorFrameUtil, []);
windowHandler.closeScreenSharingIndicator();
}
if (
@ -773,7 +773,7 @@ export const reloadWindow = (browserWindow: ICustomBrowserWindow) => {
windowHandler.closeAllWindows();
windowHandler.execCmd(windowHandler.screenShareIndicatorFrameUtil, []);
windowHandler.closeScreenSharingIndicator();
return;
}