Skip to content

Commit

Permalink
Merge pull request #13 from matheoleger/hotfix/display
Browse files Browse the repository at this point in the history
fix(display): invert display to fix problem
  • Loading branch information
matheoleger authored Apr 11, 2023
2 parents b2af0b8 + 5de7c37 commit 9dc54cd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,21 @@ const createWindow = () => {

//Set to fullscreen
win.webContents.ipc.on("fullscreen-app", (e, data) => {
win.setFullScreen(true);
let display = screen.getAllDisplays();
let externalDisplay = display.find((display) => {
return display.bounds.x !== 0 || display.bounds.y !== 0;
});

if (externalDisplay) {
dual = createDualSplitWindow(data, externalDisplay);
win.setPosition(externalDisplay.bounds.x + 50, externalDisplay.bounds.y + 50);
}

win.setFullScreen(true);

});


win.webContents.ipc.on("execute-command", (e, data) => {
executeCommand(data); //Execute and send output data
});
Expand All @@ -104,14 +108,13 @@ const createDualSplitWindow = (data: any, externalDisplay: Electron.Display) =>
width: 800,
height: 600,
show: false,
x: externalDisplay.bounds.x + 50,
y: externalDisplay.bounds.y + 50,
webPreferences: {
preload: join(__dirname, "src/preload/preload.js"),
nodeIntegration: false,
contextIsolation: true,
},
});

if (app.isPackaged) {
dual.loadFile("./build/index.html");
} else {
Expand Down

0 comments on commit 9dc54cd

Please sign in to comment.