desktopCapturer - source that is currently in focus

I am using the desktopCapturer in my renderer.js to capture a particular desktop Source. Now in addition to capturing the source, I want to control the source from my electron app, for example, I want to put a menu on top of the captured source. My question is how do I restrict the electron app to work with a particular source. If I go to a different window (out of focus from the source), the electron app should lose the control. Currently, I am able to associate/place the electron app with/on any source/window currently open in the desktop.