cocoa_common: improve conditional dock hiding from 3259e4a7a