Caused by declaring a variable later than a conditionally compiled piece of code.
Net result is that Mac will be less tolerant of a window partly off the top of the screen than Windows will be, and will reset it to the default.
Splash screen still always appears on first screen (intentional).
Also I fixed issue where new project windows would appear on first screen, even if Audacity on second.
Fixed by being more tolerant of window being (slightly) off screen. Windows 10 appears to mis-report the window size by 6 pixels. This fix allows the user to restore a window that is (slightly) off screen. That's OK and helps those users who position and size the window very precisely.
Problem was that cfd7648fce2388ec8ae35b38004f2ae111c484af fixed a memory leak
but created a dangling pointer bug, which does not happen during usual run
of Audacity because AudacityProject::OnCloseWindow is reached then before
destroying AudacityProject.
Fixed it by using a std::shared_pointer for the TrackList that both
AudacityProject and TrackPanel must use.
This introduces a new variable, mStopIfWasPaused (default true). Actions which require AudioIONotBusyFlag will now stop the audio, if audio was busy but paused and attempt to continue.
We could perhaps make mStopAudioIfWasPaused into a preference, but I don't think we need to keep even the option of the old behaviour.
There is a very slight performance cost in using the sample-format set in preferences that does not seem to matter in practice. That's because the status message is updated infrequently, not every screen refresh, and the actual cost per look up is small. See http://bugzilla.audacityteam.org/show_bug.cgi?id=1436 for information on slow reading of preferences.
Fix for this bug: If the cursor/selection start is moved using the keyboard, then
audio position shows the previous cursor/selection start.
Simple fix in void AudacityProject::TP_DisplaySelection(). The play region is now updated
before its start is used for audio position.
... This affects those keys (and NUMPAD arrows), also (shift-)ctrl-f6,
ctrl-home, ctrl-end (which are command-left and right on mac)
Those should be tested to ensure correct restoration of the yellow rectangle,
appropriately in the tracks or the ruler.
This should also be tested with and without the Tracks preference for cyclic
movement of the focus.