Fix bug 325193: sheet shows up in lower left corner of the screen. Fixed by converting it to a modal dialog if its parent window is not visible.

This commit is contained in:
smfr%smfr.org 2006-01-30 05:52:18 +00:00
Родитель face90c3bb
Коммит cc3ed91dc6
1 изменённых файлов: 11 добавлений и 8 удалений

Просмотреть файл

@ -398,14 +398,17 @@ const int kLabelCheckboxAdjustment = 2; // # pixels the label must be pushed dow
- (int)runModalWindow:(NSWindow*)inDialog relativeToWindow:(NSWindow*)inParentWindow
{
// If there is already a modal window up, convert a sheet into a modal window,
// because AppKit will hang if you try to do this (possibly because we're using
// the deprecated and sucky runModalForWindow:relativeToWindow:).
// Also, if the parent window already has an attached sheet, also null out
// the parent and show this as a modal dialog.
if ([NSApp modalWindow] || (inParentWindow && [inParentWindow attachedSheet]))
inParentWindow = nil;
if (inParentWindow)
{
// If there is already a modal window up, convert a sheet into a modal window,
// because AppKit will hang if you try to do this (possibly because we're using
// the deprecated and sucky runModalForWindow:relativeToWindow:).
// Also, if the parent window already has an attached sheet, or is not visible,
// also null out the parent and show this as a modal dialog.
if ([NSApp modalWindow] || [inParentWindow attachedSheet] || ![inParentWindow isVisible])
inParentWindow = nil;
}
int result;
if (inParentWindow)
result = [NSApp runModalForWindow:inDialog relativeToWindow:inParentWindow];