diff --git a/camino/CHBrowserWrapper.mm b/camino/CHBrowserWrapper.mm index 9d8aa4f8d73..d459866799c 100644 --- a/camino/CHBrowserWrapper.mm +++ b/camino/CHBrowserWrapper.mm @@ -185,8 +185,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; - (void)setFrame:(NSRect)frameRect { [super setFrame:frameRect]; - NSRect bounds = [self bounds]; - [mBrowserView setFrame:bounds]; + + // Only resize our browser view if we are visible. If we're hidden, the frame + // will get reset when we get placed back into the view hierarchy anyway. This + // enhancement keeps resizing in a window with many tabs from being slow. + if ([self window]) { + NSRect bounds = [self bounds]; + [mBrowserView setFrame:bounds]; + } } -(BOOL)isBusy diff --git a/camino/src/browser/BrowserWrapper.mm b/camino/src/browser/BrowserWrapper.mm index 9d8aa4f8d73..d459866799c 100644 --- a/camino/src/browser/BrowserWrapper.mm +++ b/camino/src/browser/BrowserWrapper.mm @@ -185,8 +185,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; - (void)setFrame:(NSRect)frameRect { [super setFrame:frameRect]; - NSRect bounds = [self bounds]; - [mBrowserView setFrame:bounds]; + + // Only resize our browser view if we are visible. If we're hidden, the frame + // will get reset when we get placed back into the view hierarchy anyway. This + // enhancement keeps resizing in a window with many tabs from being slow. + if ([self window]) { + NSRect bounds = [self bounds]; + [mBrowserView setFrame:bounds]; + } } -(BOOL)isBusy diff --git a/chimera/CHBrowserWrapper.mm b/chimera/CHBrowserWrapper.mm index 9d8aa4f8d73..d459866799c 100644 --- a/chimera/CHBrowserWrapper.mm +++ b/chimera/CHBrowserWrapper.mm @@ -185,8 +185,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; - (void)setFrame:(NSRect)frameRect { [super setFrame:frameRect]; - NSRect bounds = [self bounds]; - [mBrowserView setFrame:bounds]; + + // Only resize our browser view if we are visible. If we're hidden, the frame + // will get reset when we get placed back into the view hierarchy anyway. This + // enhancement keeps resizing in a window with many tabs from being slow. + if ([self window]) { + NSRect bounds = [self bounds]; + [mBrowserView setFrame:bounds]; + } } -(BOOL)isBusy diff --git a/chimera/src/browser/BrowserWrapper.mm b/chimera/src/browser/BrowserWrapper.mm index 9d8aa4f8d73..d459866799c 100644 --- a/chimera/src/browser/BrowserWrapper.mm +++ b/chimera/src/browser/BrowserWrapper.mm @@ -185,8 +185,14 @@ static const char* ioServiceContractID = "@mozilla.org/network/io-service;1"; - (void)setFrame:(NSRect)frameRect { [super setFrame:frameRect]; - NSRect bounds = [self bounds]; - [mBrowserView setFrame:bounds]; + + // Only resize our browser view if we are visible. If we're hidden, the frame + // will get reset when we get placed back into the view hierarchy anyway. This + // enhancement keeps resizing in a window with many tabs from being slow. + if ([self window]) { + NSRect bounds = [self bounds]; + [mBrowserView setFrame:bounds]; + } } -(BOOL)isBusy