FileBasedDocument's windows positions

The alertWindows opened by FileBasedDocument can be at the wrong position, because no ‘associated component’ is passed to the alertWindows constructor.

To reproduce :

  • open 2 projects A and B in the projucer
  • do a modification in project A
  • bring the window of project B to the front
  • click on the close button of the window of project A (while project B is still the front project)

As a result, the Save alert window will be centered in Project B window instead of A, which is an important source of confusion!

Can we have an extra argument for the different FileBasedDocument’s methods that open a window ?

SaveResult saveIfNeededAndUserAgrees (Component* componentToCentreAround = nullptr)
{
[...]

   AlertWindow::showYesNoCancelBox ([...], componentToCentreAround);
[...]
}