Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

unknown

Operating System:

Windows 10 (2004)

Last Known Working Electron version:

unknown

Expected Behavior

Rendering does not change.

Actual Behavior

Dots bleed out over time from various elements until state is changed (mouseover/highlight/...)

To Reproduce

Open electron app and wait. Reliably happens on Slack, VSCode, GitHub Desktop

Screenshots

Additional Information

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

The screen capture event is calling in every 5 minutes by using the setInterval method and its working good in case of "unlock-screen" in window 10, however, when the window screen is locked(Window+L), the below exception has generated.

sources.map is not a function at Desktopcapture.handlEmitOnCapture

Electron Version:

v6.0.7

Operating System:

Windows 10 Pro(1803)

Last Known Working Electron version:

Actual Behavior

Desktopcapture.getSources(optinal,callback) does not handle "lock-screen" nor handlling uncaughtException. Below exception is generating.

Expected Behavior

Desktopcapture.getSources(optinal,callback) should handle "lock-screen" / handles uncaughtException.

To Reproduce

Step 1: Copy below code

const electron = require('electron');

const desktopCapturer = electron.desktopCapturer;

const remote = electron.remote;

const electronScreen = remote.screen;

const fs = require('fs');

const path = require('path');

const os = require('os');

var screenShotPath = '';

let getScreenCapture = function () {

const timeoutScheduled = Date.now();
const thumbSize = determineScreenshot();
console.log(thumbSize.height);
console.log(thumbSize.width);
let options = { types: ['screen'], thumbnailSize: thumbSize };

desktopCapturer.getSources(options, function (error, sources) {
if (error) {
console.log(error.message);
return;
}
sources.forEach(function (source) {
screenShotPath = path.join(os.tmpdir, 'screenshot_' + timeoutScheduled + '.jpeg');
console.log(screenShotPath);
fs.writeFile(screenShotPath, source.thumbnail.toPNG(), function (err) {
if (err) return console.log(err.message);

});

});

});

}

setInterval(function () {

getScreenCapture();

console.log('Captured');

}, 5000);

function determineScreenshot() {

const screensize = electronScreen.getPrimaryDisplay().workAreaSize;

const maxDimension = Math.max(screensize.width, screensize.height);
console.log(maxDimension);

return {
width: maxDimension * window.devicePixelRatio,
height: maxDimension * window.devicePixelRatio
};

}

Step 2: Install npm & run this code.

Step 3: Lock your window screen (Window + L). Lock your screen at least 10 minutes.

Step 4: Unlock your widow screen and see the Dialog box popups with the below error message.

Screenshots

Additional Information

Also other errors logs in the terminal

[19164:1007/163453.079:ERROR:dxgi_output_duplicator.cc(170)] Failed to capture frame, error 000001EB5A7F5380, code -2005270490

[19164:1007/163453.095:ERROR:screen_capturer_win_directx.cc(140)] DxgiDuplicatorController failed to capture desktop, error code Duplication failed

[19164:1007/163528.058:ERROR:dxgi_output_duplicator.cc(170)] Failed to capture frame, error 000001EB5A871850, code -2005270490

[19164:1007/163528.552:ERROR:screen_capturer_win_directx.cc(140)] DxgiDuplicatorController failed to capture desktop, error code Duplication failed

[19164:1007/163538.072:ERROR:dxgi_output_duplicator.cc(170)] Failed to capture frame, error 000001EB5A878A70, code -2005270490

[19164:1007/163538.077:ERROR:screen_capturer_win_directx.cc(140)] DxgiDuplicatorController failed to capture desktop, error code Duplication failed

[19164:1007/163543.058:ERROR:dxgi_output_duplicator.cc(170)] Failed to capture frame, error 000001EB5A878A70, code -2005270490

[19164:1007/163543.061:ERROR:screen_capturer_win_directx.cc(140)] DxgiDuplicatorController failed to capture desktop, error code Duplication failed

There was an uncaught error TypeError: sources.map is not a function

at DesktopCapturer.handlEmitOnCapturer (~\node_modules\electron\dist\resources\electron.asar\browser\desktop-capturer.js:72:32)