]> khamidou — GitHub mirrors - electron.git/commitdiff
example code didn't run
authorhansrwindhoff <hansrwindhoff@gmail.com>
Mon, 5 Oct 2015 02:14:52 +0000 (20:14 -0600)
committerhansrwindhoff <hansrwindhoff@gmail.com>
Mon, 5 Oct 2015 02:14:52 +0000 (20:14 -0600)
docs/api/screen.md

index da15c7326f172a5c7abda5f286eddb76bb0d4b70..9afbf02170e11974ed2604e9be942e2bfb946487 100644 (file)
@@ -37,8 +37,8 @@ app.on('ready', function() {
   var electronScreen = require('screen');
   var displays = electronScreen.getAllDisplays();
   var externalDisplay = null;
-  for (var i in displays) {
-    if (displays[i].bounds.x > 0 || displays[i].bounds.y > 0) {
+  for (var i =0; i< displays.length; i++) {
+    if (displays[i].bounds.x !==0 || displays[i].bounds.y !== 0) {
       externalDisplay = displays[i];
       break;
     }
@@ -48,6 +48,8 @@ app.on('ready', function() {
     mainWindow = new BrowserWindow({
       x: externalDisplay.bounds.x + 50,
       y: externalDisplay.bounds.y + 50,
+       width: 900,
+       height:600
     });
   }
 });