Make panel hide intelligently with shaded windows (bug #11371)