gluon-framework / gluon

A new framework for creating desktop apps from websites, using system installed browsers and NodeJS
https://gluonjs.org
MIT License
3.1k stars 76 forks source link

Window position management #53

Open smartfrigde opened 1 year ago

smartfrigde commented 1 year ago

Electron allows developers to spawn the window at specific X/Y on the screen, an api to gather current position of the window would be also useful. An implementation respecting multi-monitor setups should be considered.

Example:

const Window = await Gluon.open('https://gluonjs.org', {
  x: 360,
  y: 200
});
Window.ipc.getWindowX = () => {
  return Window.Page.x;
};
Window.ipc.getWindowY = () => {
  return Window.Page.y;
};