Merge pull request #1355 from primalmotion/cappuccino

---

if setTitle: is called on a CPWindow with the primaryPlatformWindow as platformWindow,
the main pages title is changed. This patch prevent changing the primaryPlatformWindows title.
This is not optimal, but this is better than changing the title at each window setTitle: call
This commit is contained in:
Alexander Ljungberg committed 2011-09-17 10:55:43 +01:00
commit c8991e07b9
3 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -481,7 +481,7 @@ CPTexturedBackgroundWindowMask
[self close];
_platformWindow = aPlatformWindow;
[_platformWindow setTitle:_title];
[_platformWindow _setTitle:_title window:self];
if (wasVisible)
[self orderFront:self];
@@ -1367,7 +1367,7 @@ CPTexturedBackgroundWindowMask
_title = aTitle;
[_windowView setTitle:aTitle];
[_platformWindow setTitle:_title];
[_platformWindow _setTitle:_title window:self];
[self _synchronizeMenuBarTitleWithWindowTitle];
}
+2 -2
View File
@@ -259,12 +259,12 @@ var PrimaryPlatformWindow = NULL;
return [CPPlatform isBrowser];
}
- (void)setTitle:(CPString)aTitle
- (void)_setTitle:(CPString)aTitle window:(CPWindow)aWindow
{
_title = aTitle;
#if PLATFORM(DOM)
if (_DOMWindow && _DOMWindow.document)
if (_DOMWindow && _DOMWindow.document && (aWindow === [CPApp mainWindow]))
_DOMWindow.document.title = _title;
#endif
}
+2 -1
View File
@@ -541,7 +541,8 @@ var ModifierKeyCodes = [
// FIXME: cpSetFrame?
_DOMWindow.document.write("<!DOCTYPE html><html lang='en'><head></head><body style='background-color:transparent;'></body></html>");
_DOMWindow.document.close();
_DOMWindow.document.title = _title;
if (self != [CPPlatformWindow primaryPlatformWindow])
_DOMWindow.document.title = _title;
if (![CPPlatform isBrowser])
{