intelligent positioning so context menu doesn't extend past window boundaries