Why is focus triggered on Windows but not on macOS in Electron?

Viewed 178

I use Electron 10 and I noticed a different behavior of events between Windows and macOS. In my example I register a variety of focus and drag/drop events.

On Windows, when I drag a file or directory over the Electron BrowserWindow, I get the drag/drop console outputs AND the focus event. On macOS the focus event is not triggered. Should the behavior be the same between on both systems? See the code below:

window.addEventListener("focus", function(event) 
{ 
    console.log("focus"); // < Why is this printed on Windows...
    // ... but not on macOS when a directory or file is dragged onto the window?

}, false);

window.addEventListener("dragover", function(event) 
{ 
    console.log("dragover"); // correctly triggered on both Operating Systems
}, false);
0 Answers
Related