I am working on a packaged app that will use multiple displays. I need to be able to open windows in specific displays. I've also tried opening windows and then, using javascript, moving them to a monitor. But the app will not move any further than the bounds of the active display.
Any ideas on how to get this to work?
Use chrome.system.display.getInfo
with this you can get the display info for each active display.
With displayInfo.workArea
you can get the working area of each display, you just have to think of one big display and each display is a workArea. With this information you can move your window with
AppWindow#setBounds
to the correct monitor. Be carfull, AppWindow#moveTo
is not working.
Use AppWindow#setBounds
E.g.
chrome.app.window.get('mainWindow').setBounds({"height": 200, "left": 2000})
Tested on v34
Boom. Change this to correct answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With