Electron desktopCapturer.getSources cannot capture windows

electron screencap function
because screencap takes a long time, it will take up a lot of cpu and memory, and then stop it every n minutes, and then record it again.
but if you cut to another window during the second recording, desktopCapturer.getSources can only capture the current window. How to solve this?

May.23,2022
Menu