Electron Version: 2.0.2 (also tried on 1.7.9, with same results)
Operating System (Platform and Version): Windows 10 Professional
This is the minimal code I've found that produces the problem, placed in electron-starter.js:
const electron = require("electron");
const { app, BrowserWindow } = electron;
app.on("ready", () => {
let window = new BrowserWindow();
electron.screen.on("display-added", () => {
window.loadURL("https://www.github.com/");
});
});
If you have multiple displays, you can reproduce this issue by either plugging in a display, or using Win+P to switch between single screen and extend modes. For some reason, doing this with the above code will cause the "display-added" event to trigger indefinitely.
It doesn't matter if the window is created inside or outside of the callback, nor does it matter what URL (including file paths) is being loaded. I also found by accident that calling a nonexistent method on the window (such as window.asdf()) results in the same problem. Of the few other BrowserWindow methods I've tried, no others caused the same issue.
Any idea what might be going on here?
Thanks in advance for your help!
This is the minimal code I've found that produces the problem, placed in electron-starter.js:
If you have multiple displays, you can reproduce this issue by either plugging in a display, or using Win+P to switch between single screen and extend modes. For some reason, doing this with the above code will cause the "display-added" event to trigger indefinitely.
It doesn't matter if the window is created inside or outside of the callback, nor does it matter what URL (including file paths) is being loaded. I also found by accident that calling a nonexistent method on the window (such as
window.asdf()
) results in the same problem. Of the few other BrowserWindow methods I've tried, no others caused the same issue.Any idea what might be going on here? Thanks in advance for your help!