mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
SDA-3646 Share screen hack
This commit is contained in:
parent
f056bac43e
commit
ca983d847e
@ -157,6 +157,7 @@ export class WindowHandler {
|
|||||||
private aboutAppWindow: Electron.BrowserWindow | null = null;
|
private aboutAppWindow: Electron.BrowserWindow | null = null;
|
||||||
private welcomeScreenWindow: Electron.BrowserWindow | null = null;
|
private welcomeScreenWindow: Electron.BrowserWindow | null = null;
|
||||||
private screenPickerWindow: Electron.BrowserWindow | null = null;
|
private screenPickerWindow: Electron.BrowserWindow | null = null;
|
||||||
|
private screenPickerPlaceholderWindow: Electron.BrowserWindow | null = null;
|
||||||
private screenSharingIndicatorWindow: Electron.BrowserWindow | null = null;
|
private screenSharingIndicatorWindow: Electron.BrowserWindow | null = null;
|
||||||
private screenSharingFrameWindow: Electron.BrowserWindow | null = null;
|
private screenSharingFrameWindow: Electron.BrowserWindow | null = null;
|
||||||
private basicAuthWindow: Electron.BrowserWindow | null = null;
|
private basicAuthWindow: Electron.BrowserWindow | null = null;
|
||||||
@ -902,6 +903,12 @@ export class WindowHandler {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'screen-sharing-indicator':
|
case 'screen-sharing-indicator':
|
||||||
|
if (
|
||||||
|
this.screenPickerPlaceholderWindow &&
|
||||||
|
windowExists(this.screenPickerPlaceholderWindow)
|
||||||
|
) {
|
||||||
|
this.screenPickerPlaceholderWindow.close();
|
||||||
|
}
|
||||||
if (winKey) {
|
if (winKey) {
|
||||||
const browserWindow = this.windows[winKey];
|
const browserWindow = this.windows[winKey];
|
||||||
|
|
||||||
@ -1454,6 +1461,31 @@ export class WindowHandler {
|
|||||||
logger.info(`window-handler: screen-source-selected`, source, id);
|
logger.info(`window-handler: screen-source-selected`, source, id);
|
||||||
if (source == null) {
|
if (source == null) {
|
||||||
this.execCmd(this.screenShareIndicatorFrameUtil, []);
|
this.execCmd(this.screenShareIndicatorFrameUtil, []);
|
||||||
|
if (
|
||||||
|
this.screenPickerPlaceholderWindow &&
|
||||||
|
windowExists(this.screenPickerPlaceholderWindow)
|
||||||
|
) {
|
||||||
|
this.screenPickerPlaceholderWindow.close();
|
||||||
|
this.screenPickerPlaceholderWindow = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// SDA-3646 hack for macOS: whenever we try to close the penultimate window (here screensharing screen picker), Electron activates the last Electron window
|
||||||
|
// This behaviour was observed while trying to upgrade from Electron 14 to Electron 17
|
||||||
|
// Here the hack to solve that issue is to create a new invisible BrowserWindow.
|
||||||
|
if (isMac) {
|
||||||
|
this.screenPickerPlaceholderWindow = new BrowserWindow({
|
||||||
|
width: 0,
|
||||||
|
height: 0,
|
||||||
|
transparent: true,
|
||||||
|
frame: false,
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
resizable: false,
|
||||||
|
movable: false,
|
||||||
|
fullscreenable: false,
|
||||||
|
});
|
||||||
|
this.screenPickerPlaceholderWindow.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.send('start-share' + id, source);
|
window.send('start-share' + id, source);
|
||||||
|
Loading…
Reference in New Issue
Block a user