mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-31 19:27:00 -06:00
Merge pull request #857 from johankwarnmarksymphony/sda-1708
fix: SDA-1708 Move screen-sharing indicator to the same screen as Symphony…
This commit is contained in:
commit
a85d7f3db6
@ -440,7 +440,7 @@ export class WindowHandler {
|
|||||||
/**
|
/**
|
||||||
* Move window to the same screen as main window
|
* Move window to the same screen as main window
|
||||||
*/
|
*/
|
||||||
public moveWindow(windowToMove: BrowserWindow) {
|
public moveWindow(windowToMove: BrowserWindow, fixedYPosition?: number) {
|
||||||
if (this.mainWindow && windowExists(this.mainWindow)) {
|
if (this.mainWindow && windowExists(this.mainWindow)) {
|
||||||
const display = electron.screen.getDisplayMatching(this.mainWindow.getBounds());
|
const display = electron.screen.getDisplayMatching(this.mainWindow.getBounds());
|
||||||
|
|
||||||
@ -460,7 +460,14 @@ export class WindowHandler {
|
|||||||
positionX = display.workArea.x;
|
positionX = display.workArea.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
let positionY = Math.trunc(display.workArea.y + display.workArea.height / 2 - windowToMove.getBounds().height / 2);
|
let positionY;
|
||||||
|
if (fixedYPosition) {
|
||||||
|
positionY = Math.trunc(display.workArea.y + fixedYPosition);
|
||||||
|
} else {
|
||||||
|
// Center the window in y-axis
|
||||||
|
positionY = Math.trunc(display.workArea.y + display.workArea.height / 2 - windowToMove.getBounds().height / 2);
|
||||||
|
}
|
||||||
|
|
||||||
if (positionY < display.workArea.y) {
|
if (positionY < display.workArea.y) {
|
||||||
positionY = display.workArea.y;
|
positionY = display.workArea.y;
|
||||||
}
|
}
|
||||||
@ -785,6 +792,7 @@ export class WindowHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.screenSharingIndicatorWindow = createComponentWindow('screen-sharing-indicator', opts);
|
this.screenSharingIndicatorWindow = createComponentWindow('screen-sharing-indicator', opts);
|
||||||
|
this.moveWindow(this.screenSharingIndicatorWindow, topPositionOfIndicatorScreen);
|
||||||
this.screenSharingIndicatorWindow.setVisibleOnAllWorkspaces(true);
|
this.screenSharingIndicatorWindow.setVisibleOnAllWorkspaces(true);
|
||||||
this.screenSharingIndicatorWindow.webContents.once('did-finish-load', () => {
|
this.screenSharingIndicatorWindow.webContents.once('did-finish-load', () => {
|
||||||
if (!this.screenSharingIndicatorWindow || !windowExists(this.screenSharingIndicatorWindow)) {
|
if (!this.screenSharingIndicatorWindow || !windowExists(this.screenSharingIndicatorWindow)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user