Adding external screen share indicator frame for Mac

This commit is contained in:
Mattias Gustavsson 2020-02-25 10:28:09 +01:00
parent 5099d0d190
commit 4e639039ac
2 changed files with 16 additions and 8 deletions

View File

@ -145,7 +145,7 @@
},
"optionalDependencies": {
"screen-snippet": "git+https://github.com/symphonyoss/ScreenSnippet2.git#v1.0.6",
"screen-share-indicator-frame": "git+https://github.com/symphonyoss/ScreenShareIndicatorFrame.git#v1.1.0",
"screen-share-indicator-frame": "git+https://github.com/symphonyoss/ScreenShareIndicatorFrame.git#v1.2.0",
"swift-search": "2.0.1"
}
}

View File

@ -119,10 +119,18 @@ export class WindowHandler {
this.isAutoReload = false;
this.isOnline = true;
this.screenShareIndicatorFrameUtil = !isWindowsOS ? '' : isDevEnv
? path.join(__dirname,
'../../../node_modules/screen-share-indicator-frame/ScreenShareIndicatorFrame.exe')
: path.join(path.dirname(app.getPath('exe')), 'ScreenShareIndicatorFrame.exe');
this.screenShareIndicatorFrameUtil = '';
if (isWindowsOS) {
this.screenShareIndicatorFrameUtil = isDevEnv
? path.join(__dirname,
'../../../node_modules/screen-share-indicator-frame/ScreenShareIndicatorFrame.exe')
: path.join(path.dirname(app.getPath('exe')), 'ScreenShareIndicatorFrame.exe');
} else if (isMac) {
this.screenShareIndicatorFrameUtil = isDevEnv
? path.join(__dirname,
'../../../node_modules/screen-share-indicator-frame/SymphonyScreenShareIndicator')
: path.join(path.dirname(app.getPath('exe')), 'SymphonyScreenShareIndicator');
}
this.appMenu = null;
const locale: LocaleType = (this.config.locale || app.getLocale()) as LocaleType;
@ -390,7 +398,7 @@ export class WindowHandler {
if (browserWindow && windowExists(browserWindow)) {
browserWindow.destroy();
if (isWindowsOS) {
if (isWindowsOS || isMac) {
this.execCmd(this.screenShareIndicatorFrameUtil, []);
} else {
if (this.screenSharingFrameWindow && windowExists(this.screenSharingFrameWindow)) {
@ -790,8 +798,8 @@ export class WindowHandler {
displays.forEach((element) => {
if (displayId === element.id.toString()) {
if (isWindowsOS) {
logger.info(`window-handler: element:`, element);
logger.info(`window-handler: element:`, element);
if (isWindowsOS || isMac) {
this.execCmd(this.screenShareIndicatorFrameUtil, [ displayId ]);
} else {
this.createScreenSharingFrameWindow('screen-sharing-frame',