Minimize OBS, or put it behind the window you're trying to capture. It will continue to record.
If you need to have OBS up in the foreground while you're recording, then you will probably need to use a window capture source instead of display capture. Display capture will always capture exactly what you're seeing on the monitor, in its entirety.