Added repositioning checks so the gesture targets never show up behind the quit button.