Skip to content

Commit

Permalink
SDA-4636 Fix for missing screen share indicator frame (#2186)
Browse files Browse the repository at this point in the history
* SDA-4636 Fix for missing screen share indicator frame

* SDA-4612 Upgrade [email protected] to get the fix on showInactive
  • Loading branch information
sbenmoussati authored Aug 16, 2024
1 parent 90d1aa2 commit 452b844
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"builder-util-runtime": "^9.0.3",
"cross-env": "7.0.3",
"del": "3.0.0",
"electron": "31.3.0",
"electron": "31.4.0",
"electron-builder": "^24.13.2",
"electron-devtools-installer": "^3.2.0",
"electron-icon-maker": "0.0.5",
Expand Down Expand Up @@ -233,7 +233,7 @@
},
"optionalDependencies": {
"@symphony/symphony-c9-shell": "3.30.0-37.176",
"screen-share-indicator-frame": "git+https://github.com/finos/ScreenShareIndicatorFrame.git#v1.4.13",
"screen-share-indicator-frame": "git+https://github.com/finos/ScreenShareIndicatorFrame.git#v1.5.0",
"screen-snippet": "git+https://github.com/finos/ScreenSnippet2.git#9.2.2",
"symphony-native-window-handle-helper": "github:finos/SymphonyWindowsHwndHelper#1.0.1",
"winreg": "^1.2.4"
Expand Down
35 changes: 20 additions & 15 deletions src/app/window-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1569,25 +1569,30 @@ export class WindowHandler {
logger.info(
'window-handler: source.display_id: ' + source.display_id,
);
if (source.display_id !== '') {
const [sharedScreen] = displays.filter(
(display) => display.id.toString() === source.display_id.toString(),
);
if (sharedScreen) {
const left =
sharedScreen.nativeOrigin.x * (sharedScreen.scaleFactor || 1);
const top =
sharedScreen.nativeOrigin.y * (sharedScreen.scaleFactor || 1);
const right =
left +
sharedScreen.bounds.width * (sharedScreen.scaleFactor || 1);
const bottom =
top +
sharedScreen.bounds.height * (sharedScreen.scaleFactor || 1);
this.execCmd(this.screenShareIndicatorFrameUtil, [
source.display_id,
left.toString(),
top.toString(),
right.toString(),
bottom.toString(),
]);
} else {
const dispId = source.id.split(':')[1];
const clampedDispId = Math.min(dispId, displays.length - 1);
const keyId = 'id';
logger.info('window-utils: dispId: ' + dispId);
logger.info('window-utils: clampedDispId: ' + clampedDispId);
logger.info(
'window-utils: displays [' +
clampedDispId +
'] [id]: ' +
displays[clampedDispId][keyId],
logger.error(
`window-handler: no screen found with id ${source.display_id}`,
);
this.execCmd(this.screenShareIndicatorFrameUtil, [
displays[clampedDispId][keyId].toString(),
]);
}
}
}
Expand Down

0 comments on commit 452b844

Please sign in to comment.