Merge pull request #877 from mattias-symphony/master

feat: Adding external screen share indicator frame for Mac
This commit is contained in:
mattias-symphony 2020-02-26 16:21:55 +01:00 committed by GitHub
commit 7af64fa0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 10 deletions

View File

@ -48,7 +48,8 @@
"library/indexvalidator.exec",
"library/cryptoLib.dylib",
"library/dictionary",
"library/lz4.exec"
"library/lz4.exec",
"node_modules/screen-share-indicator-frame/SymphonyScreenShareIndicator"
],
"mac": {
"category": "public.app-category.business",
@ -145,7 +146,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

@ -71,6 +71,7 @@ fi
codesign --force --options runtime -s "Developer ID Application: Symphony Communication Services LLC" library/lz4.exec
codesign --force --options runtime -s "Developer ID Application: Symphony Communication Services LLC" library/indexvalidator.exec
codesign --force --options runtime -s "Developer ID Application: Symphony Communication Services LLC" node_modules/screen-share-indicator-frame/SymphonyScreenShareIndicator
PKG_VERSION=$(node -e "console.log(require('./package.json').version);")

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')), '../node_modules/screen-share-indicator-frame/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)) {
@ -591,8 +599,8 @@ export class WindowHandler {
});
ipcMain.once('screen-source-selected', (_event, source) => {
if (source != null) {
logger.info(`window-handler: screen-source-selected`, source, id);
if (isWindowsOS) {
logger.info(`window-handler: screen-source-selected`, source, id);
const type = source.id.split(':')[0];
if (type === 'window') {
const hwnd = source.id.split(':')[1];
@ -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',
@ -1049,6 +1057,7 @@ export class WindowHandler {
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);