mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Ensure the project window doesn't fall underneath the menu on OSX
This commit is contained in:
parent
bb553a1cfb
commit
13dbaf11ec
@ -618,7 +618,8 @@ void GetNextWindowPlacement(wxRect *nextRect, bool *pMaximized, bool *pIconized)
|
||||
gPrefs->Read(wxT("/Window/Normal_Width"), &normalRect.width, defaultRect.width);
|
||||
gPrefs->Read(wxT("/Window/Normal_Height"), &normalRect.height, defaultRect.height);
|
||||
|
||||
// Workaround 2.1.1 and earlier bug on OSX...affects only normalRect, but be safe
|
||||
// Workaround 2.1.1 and earlier bug on OSX...affects only normalRect, but let's just
|
||||
// validate for all rects and plats
|
||||
if (normalRect.width == 0 || normalRect.height == 0) {
|
||||
normalRect = defaultRect;
|
||||
}
|
||||
@ -626,6 +627,17 @@ void GetNextWindowPlacement(wxRect *nextRect, bool *pMaximized, bool *pIconized)
|
||||
windowRect = defaultRect;
|
||||
}
|
||||
|
||||
#if defined(__WXMAC__)
|
||||
// On OSX, the top of the window should never be less than the menu height,
|
||||
// so something is amiss if it is
|
||||
if (normalRect.y < defaultRect.y) {
|
||||
normalRect = defaultRect;
|
||||
}
|
||||
if (windowRect.y < defaultRect.y) {
|
||||
windowRect = defaultRect;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gAudacityProjects.IsEmpty()) {
|
||||
if (*pMaximized || *pIconized) {
|
||||
*nextRect = normalRect;
|
||||
|
Loading…
x
Reference in New Issue
Block a user