Give the context menu its proper behaviour and modify TrackPopupMenu