hydra icon indicating copy to clipboard operation
hydra copied to clipboard

feat(window): better window placing

Open scrlkx opened this issue 9 months ago • 0 comments

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,
    });

scrlkx avatar May 11 '24 15:05 scrlkx