External monitor shows part of the window only and black elsewhere
Sometimes when I connect my external monitor with my laptop with HDMI cable, I see the external screen becoming black. The top bar is still visible and if I swipe up the applications, I can see the applications. How do I debug this? I have attached the relevant images. If I restart the mac, it works perfectly. It is not possible to restart whenever this issue happens.
MacBook Pro 16″