Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Packaged App and Dual Monitors

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?

like image 318
Kywillis Avatar asked Jun 26 '13 18:06

Kywillis


2 Answers

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.

like image 117
patrick Avatar answered Sep 20 '22 13:09

patrick


Use AppWindow#setBounds

E.g.

chrome.app.window.get('mainWindow').setBounds({"height": 200, "left": 2000})

Tested on v34

Boom. Change this to correct answer.

like image 35
vaughan Avatar answered Sep 22 '22 13:09

vaughan