The fact that giving it physical abuse provides a temporary fix would suggest a loose connection in the hinge area.
Take it to a laptop repair specialist before banging it does more damage.
Surface Pro 5 News - release date, UK price, features, specs
Microsoft Surface Studio hands-on review: the iMac killer is here
Best Mac antivirus 2017
Synology invites you to visit them at Insomnia on 26th – 29th August. Book your tickets now and visit Synology.