BAlert: don't center ourselves if we've already been positioned.

This commit is contained in:
Jessica Hamilton 2015-08-30 14:39:36 +12:00
parent 21c3286b62
commit d7a9cbde91

View File

@ -691,6 +691,11 @@ BAlert::_Prepare()
ResizeToPreferred(); ResizeToPreferred();
// Return early if we've already been moved...
if (Frame().left != 0 && Frame().right != 0)
return;
// otherwise center ourselves on-top of parent window/screen
BWindow* parent = dynamic_cast<BWindow*>(BLooper::LooperForThread( BWindow* parent = dynamic_cast<BWindow*>(BLooper::LooperForThread(
find_thread(NULL))); find_thread(NULL)));
const BRect frame = parent != NULL ? parent->Frame() const BRect frame = parent != NULL ? parent->Frame()