diff options
author | andresantoso <andresantoso@chromium.org> | 2015-03-30 12:32:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-30 19:33:26 +0000 |
commit | 4f93ae284db6d9726397dfbddd682a04567911d7 (patch) | |
tree | 40ba0649c8f0976c986884ca3f4e6b02f2ec1078 /ui/base | |
parent | 90741fd16abc6fb90874cdc2ac6c5737af0943dc (diff) | |
download | chromium_src-4f93ae284db6d9726397dfbddd682a04567911d7.zip chromium_src-4f93ae284db6d9726397dfbddd682a04567911d7.tar.gz chromium_src-4f93ae284db6d9726397dfbddd682a04567911d7.tar.bz2 |
Mac: Update tracking area workaround.
http://crrev.com/941543002 did not succeed in fixing the crashes from
http://crbug.com/315379, and caused a regression http://crbug.com/470035.
This patch is a partial revert to reset the tracking area every time the
view is resized, but only applies the workaround on 10.7 to 10.9,
since the AppKit bug was introduced on 10.7 and is fixed on 10.10.
BUG=470035,315379
Review URL: https://codereview.chromium.org/1046823003
Cr-Commit-Position: refs/heads/master@{#322837}
Diffstat (limited to 'ui/base')
-rw-r--r-- | ui/base/cocoa/base_view.mm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/base/cocoa/base_view.mm b/ui/base/cocoa/base_view.mm index 6f7b540..27962b9 100644 --- a/ui/base/cocoa/base_view.mm +++ b/ui/base/cocoa/base_view.mm @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "ui/base/cocoa/base_view.h" +#include "base/mac/mac_util.h" NSString* kViewDidBecomeFirstResponder = @"Chromium.kViewDidBecomeFirstResponder"; @@ -51,14 +52,18 @@ NSString* kSelectionDirection = @"Chromium.kSelectionDirection"; } } -- (void)viewDidEndLiveResize { - [super viewDidEndLiveResize]; +- (void)updateTrackingAreas { + [super updateTrackingAreas]; // NSTrackingInVisibleRect doesn't work correctly with Lion's window resizing, // http://crbug.com/176725 / http://openradar.appspot.com/radar?id=2773401 . // Work around it by reinstalling the tracking area after window resize. - [self disableTracking]; - [self enableTracking]; + // This AppKit bug is fixed on Yosemite, so we only apply this workaround on + // 10.7 to 10.9. + if (base::mac::IsOSMavericksOrEarlier() && base::mac::IsOSLionOrLater()) { + [self disableTracking]; + [self enableTracking]; + } } - (void)mouseEvent:(NSEvent*)theEvent { |