In OBS Studio, when you capture a window application whose size is smaller or different than the size of the base canvas, you will get black useless space.
There is a feature that allow you to easily resize the base canvas to fit the same size as you application window. It is called Resize output (source size). Right on your Window Capture source and select Resize output (source size).
The result will look like this.