Fixed: a sheet's parent window did not become main

Sheets are like child windows, they can never become main. Previously, when an attempt was made to make a sheet the main window, its parent window did not become main as it should have. Thus the title bar would remain dimmed, even though the sheet was the key window.

With this commit, when a sheet is made main, it defers to the parent window.
This commit is contained in:
Aparajita Fishman committed 2013-03-13 15:04:34 -04:00
1 parent 25d5441444
commit 3301754af2
2 files changed
+9 -2

No files matched your search

+1 -1
View File
@@ -1025,7 +1025,7 @@ CPRunContinuesResponse = -1002;
var aWindow = [_windows objectAtIndex:count],
context = aWindow._sheetContext;
if (context != nil && context["sheet"] === sheet)
if (context && context["sheet"] === sheet)
{
context["returnCode"] = returnCode;
[aWindow _endSheet];
+8 -1
View File
@@ -871,7 +871,7 @@ CPTexturedBackgroundWindowMask
{
#if PLATFORM(DOM)
// -dw- if a sheet is clicked, the parent window should come up too
if ([self isSheet])
if (_isSheet)
[_parentView orderFront:self];
if (!_isVisible)
@@ -2321,6 +2321,13 @@ CPTexturedBackgroundWindowMask
*/
- (void)makeMainWindow
{
// Sheets cannot be main. Their parent window becomes main.
if (_isSheet)
{
[_parentView makeMainWindow];
return;
}
if ([CPApp mainWindow] === self || ![self canBecomeMainWindow])
return;