13

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?

Kywillis
  • 707
  • 1
  • 8
  • 19
  • From what I've seen, Chrome tends to be icky when it comes to multiple monitors. If I change my primary display (I have 3 monitors) the chrome screen will go black and unresponsive. It's most likely some internal issue in chrome that stops this. –  Jun 26 '13 at 19:06
  • Another thought I had was to use the Chrome Native Client SDK for window management. I don't know much about the SDK however. Would it be possible to control a window using that? – Kywillis Jun 26 '13 at 19:12
  • That is mostly for integrating desktop applications into the browser. It could very well work, it just depends on the level of access you get with chrome. –  Jun 26 '13 at 19:14
  • This is an internal application so there are no restrictions on the permissions or the setup. If it is possible in Chrome then I would be able to use it. – Kywillis Jun 26 '13 at 19:17
  • 4
    Issue 236996: window.moveTo doesn't work across multiple monitors: https://code.google.com/p/chromium/issues/detail?id=236996 – Vincent Scheib Jun 26 '13 at 19:52

4 Answers4

4

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.

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
patrick
  • 826
  • 1
  • 9
  • 28
1

This was not the solution I was hoping for but as one of the comments mentioned there is a bug with Chrome and multiple monitors. In my case this is an internal application so I'm able to install anything i need to make this work.

My solution was to create a console application which launches the chrome app and then moves the windows around using the Windows32 API. Obviously not ideal but it works and the user still just needs one click to launch the app.

Kywillis
  • 707
  • 1
  • 8
  • 19
1

Use AppWindow#setBounds

E.g.

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

Tested on v34

Boom. Change this to correct answer.

vaughan
  • 6,982
  • 6
  • 47
  • 63
1

You can write a chrome extension to get this done. In the Background script you can listen to chrome.windows.onCreated event and use chrome.windows.update function to move the windows to other monitors

dilan.sp
  • 41
  • 1
  • 6