Hardware shadows rely on an unobstructed modeling view to work properly. You will get unexpected results if you have hardware shadows enabled while the modeling panel is obscured by another window.
Do not allow other windows to cover any part of your modeling view.