hydra
hydra copied to clipboard
feat(window): better window placing
When running on GNOME/Wayland it happens of placing the windows on the wrong display as it doesn't consider the primary display position.
This is the relevant part, it makes sure the new window will be placed at the right (x, y) based on the bounds of the primary display.
const primaryDisplay = screen.getPrimaryDisplay();
const { width, height } = primaryDisplay.workAreaSize;
this.mainWindow = new BrowserWindow({
x: primaryDisplay.bounds.x,
y: primaryDisplay.bounds.y,
});
However, I also introduced the change bellow that will make the window starts maximized. At this point we are manually setting the window to be 1200x720 and it's not exactly responsive. Tell me if you guys have other plans or better ideas for this.
const primaryDisplay = screen.getPrimaryDisplay();
const { width, height } = primaryDisplay.workAreaSize;
this.mainWindow = new BrowserWindow({
height: height,
width: width,
});