Fix toolbars and docks remain visible when returning from viewer bug