diff options
author | Dan Beam <dbeam@chromium.org> | 2015-10-30 11:58:49 -0700 |
---|---|---|
committer | Dan Beam <dbeam@chromium.org> | 2015-10-30 18:59:59 +0000 |
commit | 232e94bda1fb4c108eaf4188cec04e62742c79f2 (patch) | |
tree | 0b59789e81593105d9e96dd1a34427165738098d | |
parent | 9cf163b629ecedb74a8573832037b26e042455e7 (diff) | |
download | chromium_src-232e94bda1fb4c108eaf4188cec04e62742c79f2.zip chromium_src-232e94bda1fb4c108eaf4188cec04e62742c79f2.tar.gz chromium_src-232e94bda1fb4c108eaf4188cec04e62742c79f2.tar.bz2 |
Work around Omnibox popup redraw problem in El Capitan.
On El Capitan if you receive 4 items and then 6 items for the Omnibox
popup view, the OmniboxPopupViewMac resizes the window and tableview
taller but the tableview will not completely redraw itself. Overriding
the tableview's drawRect: to simply call super fixed the problem - that
suggests the Appkit is performing some optimization that doesn't always
work as Apple expects it to.
Rather than go with this no-op override, it appears that bypassing the
no-op animator reuqest to resize the window also fixes the problem (the
popup window resize animation does not run when the window gets taller).
BUG=538590
Review URL: https://codereview.chromium.org/1375993006
Cr-Commit-Position: refs/heads/master@{#356878}
(cherry picked from commit f16e7d44f18cb47ff06bbcaacde92ee0aa55db44)
Review URL: https://codereview.chromium.org/1419273005 .
Cr-Commit-Position: refs/branch-heads/2526@{#281}
Cr-Branched-From: cb947c0153db0ec02a8abbcb3ca086d88bf6006f-refs/heads/master@{#352221}
-rw-r--r-- | chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm index 9786b9b..fdd7132 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm @@ -6,6 +6,7 @@ #include <cmath> +#include "base/mac/mac_util.h" #include "base/stl_util.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/search/search.h" @@ -273,12 +274,19 @@ void OmniboxPopupViewMac::PositionPopup(const CGFloat matrixHeight) { [popup_ setAnimations:@{@"frame" : [NSNull null]}]; } - [NSAnimationContext beginGrouping]; - // Don't use the GTM addition for the "Steve" slowdown because this can happen - // async from user actions and the effects could be a surprise. - [[NSAnimationContext currentContext] setDuration:kShrinkAnimationDuration]; - [[popup_ animator] setFrame:popup_frame display:YES]; - [NSAnimationContext endGrouping]; + if (!animate && base::mac::IsOSElCapitanOrLater()) { + // When using the animator to make |popup_| larger on El Capitan, for some + // reason the window does not get redrawn. There's no animation in this case + // anyway, so just force the frame change. See http://crbug.com/538590 . + [popup_ setFrame:popup_frame display:YES]; + } else { + [NSAnimationContext beginGrouping]; + // Don't use the GTM addition for the "Steve" slowdown because this can + // happen async from user actions and the effects could be a surprise. + [[NSAnimationContext currentContext] setDuration:kShrinkAnimationDuration]; + [[popup_ animator] setFrame:popup_frame display:YES]; + [NSAnimationContext endGrouping]; + } if (!animate) { // Restore the original animations dictionary. This does not reinstate any |