Chrome Packaged App and Dual Monitors
Asked Answered
M

4

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?

Mitrewort answered 26/6, 2013 at 18:58 Comment(5)
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.Sufflate
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?Mitrewort
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.Sufflate
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.Mitrewort
Issue 236996: window.moveTo doesn't work across multiple monitors: code.google.com/p/chromium/issues/detail?id=236996Lavonia
M
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.

Mitrewort answered 27/6, 2013 at 15:25 Comment(0)
P
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.

Pythia answered 22/4, 2014 at 10:22 Comment(0)
M
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.

Mitrewort answered 27/6, 2013 at 15:25 Comment(0)
G
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.

Gouty answered 29/1, 2014 at 12:44 Comment(0)
L
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

Lessard answered 13/2, 2019 at 12:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.