P. James
P. James

Reputation: 445

Move the BrowserWindow to the bottom right

I want to ask if there's method dynamically set the position or move the Browser Window to the bottom right?

BrowserWindow.setPosition(x, y)

Upvotes: 9

Views: 6338

Answers (1)

Obsidian Age
Obsidian Age

Reputation: 42374

You can use the screen API, and use a fixed with to offset from the edge of the screen:

let display = electron.screen.getPrimaryDisplay();
let width = display.bounds.width;
win = new BrowserWindow({
  width: 600,
  x: width - 600,
  y: 0
});

Upvotes: 20

Related Questions