As mentioned here:
https://developer.chrome.com/apps/app_window#method-create
If you use ID's for you windows (as you need if you don't like to start you app twice) the position an size is getting stored. And they advice you to create the window hidden an move and re-size it before showing.
If I try to create a window on a particular screen like this:
var left = parseInt(displayInfo.workArea.left);
chrome.app.window.create('index.html', {
id: 'window-'+displayInfo.id,
hidden: true,
bounds: {left: left, top: 0, width: 100 , height: 100 }
, callbackWindow.bind(null, left, 0, displayInfo));
var callbackWindow = function (left, top, displayInfo, createdWindow) {
createdWindow.moveTo(displayInfo.workArea.left, displayInfo.workArea.top);
console.log(createdWindow.id, createdWindow.getBounds());
createdWindow.show();
};
The first time the application starts the window is on the correct position, now if we move the window and re-size it and then restart the app. The stay on the same potion as before closing.
In other words, we can not override the stored position. Is this a Bug or should it work like this?
I've made my tests on Windows 7 with Chrome 32.0.1700.107 dev-m