electron: desktopCapturer `display_id` is empty string on windows7

  • electron v3.0.3
  • windows 7
electron.desktopCapturer.getSources(options, function (error, sources) {
})

Expected Behavior have new field display_id

Actual behavior macOs-10.13.6态windows10 is right

window7, Field is present but is empty string

image

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 7
  • Comments: 28 (8 by maintainers)

Most upvoted comments

I still got this prolblem on my alienware desktop, one of our clients also met this problem on his Gaming computer.Is this problem caused by GEFORCE EXPERIENCE? BTW the electron version is 10.0.0

Hi guys! Any plan to fix it? I can confirm that it is reproduced with 3.0.10 on Windows 7 with 1 or 2 displays.

I already have a way to solve my problem, but it is not very elegant.

  let winBounds = currentWindow.getBounds();
  let targetDisplay = electronScreen.getDisplayNearestPoint({ x: winBounds.x, y: winBounds.y });
  let targetDisplayIndex = allDisplay.findIndex(dis => {
    return dis.id === targetDisplay.id
  })
  let screenName = targetDisplayIndex + 1
  desktopCapturer.getSources(options, function (error, sources) {
    sources.forEach(function (source) {
      if (source.name === 'Screen ' + screenName || source.name === 'Entire screen') {
         // todo something
      }
    }
  }

Any progress in this issue??? Some of our users are still facing this issue

still happening, display_id of all sources are empty