fix incorrect detection of context menu dimensions