Index: content/browser/renderer_host/render_widget_host_view_mac.mm |
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm |
index 7408ae19a590733ec0cd67cdaa08c006277cbc2f..2ec383da8bb1440d60af701f23227f7881438b32 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm |
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm |
@@ -368,10 +368,6 @@ void RenderWidgetHostViewMac::WasShown() { |
if (!is_hidden_) |
return; |
- // Check if the backing scale factor changed while the tab was in the |
- // background. |
- [cocoa_view_ updateTabBackingStoreScaleFactor]; |
- |
if (web_contents_switch_paint_time_.is_null()) |
web_contents_switch_paint_time_ = base::TimeTicks::Now(); |
is_hidden_ = false; |
@@ -1436,6 +1432,7 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) { |
renderWidgetHostView_.reset(r); |
canBeKeyView_ = YES; |
focusedPluginIdentifier_ = -1; |
+ deviceScaleFactor_ = ScaleFactor(self); |
// OpenGL support: |
if ([self respondsToSelector: |
@@ -2029,6 +2026,10 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) { |
return; |
float scaleFactor = ScaleFactor(self); |
+ if (scaleFactor == deviceScaleFactor_) |
+ return; |
+ deviceScaleFactor_ = scaleFactor; |
+ |
BackingStoreMac* backingStore = static_cast<BackingStoreMac*>( |
renderWidgetHostView_->render_widget_host_->GetBackingStore(false)); |
if (backingStore) // NULL in hardware path. |
@@ -2980,6 +2981,9 @@ extern NSString *NSTextInputReplacementRangeAttributeName; |
} |
- (void)viewDidMoveToWindow { |
+ if ([self window] != lastWindow_) |
Nico
2012/08/08 00:47:52
nit: I'd just say "if ([self window])", as lastWin
Avi (use Gerrit)
2012/08/08 01:01:28
Grrr. I really dislike lastWindow_; isn't that wha
sail
2012/08/09 00:25:18
Ahh makes sense.
|
+ [self updateTabBackingStoreScaleFactor]; |
+ |
if (canBeKeyView_) { |
NSWindow* newWindow = [self window]; |
// Pointer comparison only, since we don't know if lastWindow_ is still |