Bug 600901 - [clang]: cannot initialize a parameter/variable in nsCocoaWindow.mm, r=josh, a=josh

This commit is contained in:
Scott Greenlay 2010-11-17 13:48:11 -08:00
parent 4ce87fdf34
commit 7cade91cc0
2 changed files with 17 additions and 9 deletions

View File

@ -135,7 +135,11 @@ typedef struct _nsCocoaWindowList {
@end
#if defined( MAC_OS_X_VERSION_10_6 ) && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 )
@interface WindowDelegate : NSObject <NSWindowDelegate>
#else
@interface WindowDelegate : NSObject
#endif
{
nsCocoaWindow* mGeckoWindow; // [WEAK] (we are owned by the window)
// Used to avoid duplication when we send NS_ACTIVATE and

View File

@ -2282,8 +2282,9 @@ static const NSString* kStateShowsToolbarButton = @"showsToolbarButton";
{
BOOL stateChanged = ([self drawsContentsIntoWindowFrame] != aState);
[super setDrawsContentsIntoWindowFrame:aState];
if (stateChanged) {
nsCocoaWindow *geckoWindow = [[self delegate] geckoWidget];
if (stateChanged && [[self delegate] isKindOfClass:[WindowDelegate class]]) {
WindowDelegate *windowDelegate = (WindowDelegate *)[self delegate];
nsCocoaWindow *geckoWindow = [windowDelegate geckoWidget];
if (geckoWindow) {
// Re-layout our contents.
geckoWindow->ReportSizeEvent();
@ -2306,13 +2307,16 @@ static const NSString* kStateShowsToolbarButton = @"showsToolbarButton";
RollUpPopups();
nsCocoaWindow *geckoWindow = [[self delegate] geckoWidget];
if (!geckoWindow)
return;
nsEventStatus status = nsEventStatus_eIgnore;
nsGUIEvent guiEvent(PR_TRUE, NS_OS_TOOLBAR, geckoWindow);
guiEvent.time = PR_IntervalNow();
geckoWindow->DispatchEvent(&guiEvent, status);
if ([[self delegate] isKindOfClass:[WindowDelegate class]]) {
WindowDelegate *windowDelegate = (WindowDelegate *)[self delegate];
nsCocoaWindow *geckoWindow = [windowDelegate geckoWidget];
if (!geckoWindow)
return;
nsEventStatus status = nsEventStatus_eIgnore;
nsGUIEvent guiEvent(PR_TRUE, NS_OS_TOOLBAR, geckoWindow);
guiEvent.time = PR_IntervalNow();
geckoWindow->DispatchEvent(&guiEvent, status);
}
NS_OBJC_END_TRY_ABORT_BLOCK;
}