Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: ui/base/cocoa/constrained_window/constrained_window_animation.mm

Issue 1956283002: Mac: Convince the WindowServer to update the print preview shadow on retina screens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160509-Revert-Extensiony
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h" 5 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 [self setWindowStateForEnd]; 216 [self setWindowStateForEnd];
217 if ([[self delegate] respondsToSelector:@selector(animationDidEnd:)]) 217 if ([[self delegate] respondsToSelector:@selector(animationDidEnd:)])
218 [[self delegate] animationDidEnd:self]; 218 [[self delegate] animationDidEnd:self];
219 } 219 }
220 220
221 - (void)setCurrentProgress:(NSAnimationProgress)progress { 221 - (void)setCurrentProgress:(NSAnimationProgress)progress {
222 [super setCurrentProgress:progress]; 222 [super setCurrentProgress:progress];
223 223
224 if (progress >= 1.0) { 224 if (progress >= 1.0) {
225 [self setWindowStateForEnd]; 225 [self setWindowStateForEnd];
226
227 // Starting in 10.10, the WindowServer forgets to draw the shadow on windows
228 // that animate in this way on retina screens. -[NSWindow invalidateShadow]
229 // doesn't fix it. Neither does toggling -setHasShadow:. But forcing an
230 // update to the window size, and then undoing it, seems to fix the problem.
231 // See http://crbug.com/436884.
232 // TODO(tapted): Find a better fix (this is horrible).
233 NSRect frame = [window_ frame];
234 [window_ setFrame:NSInsetRect(frame, 1, 1) display:NO animate:NO];
235 [window_ setFrame:frame display:NO animate:NO];
erikchen 2016/05/09 05:29:06 uh. okay. I guess. In general I prefer moving away
tapted 2016/05/09 05:35:56 I hear ya :). I think to resolve this we'd need to
226 return; 236 return;
227 } 237 }
228 [self setWindowStateForValue:[self currentValue]]; 238 [self setWindowStateForValue:[self currentValue]];
229 } 239 }
230 240
231 - (void)setWindowStateForStart { 241 - (void)setWindowStateForStart {
232 // Subclasses can optionally override this method. 242 // Subclasses can optionally override this method.
233 } 243 }
234 244
235 - (void)setWindowStateForValue:(float)value { 245 - (void)setWindowStateForValue:(float)value {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 303 }
294 304
295 SetWindowScale(window_, scale); 305 SetWindowScale(window_, scale);
296 } 306 }
297 307
298 - (void)setWindowStateForEnd { 308 - (void)setWindowStateForEnd {
299 SetWindowScale(window_, 1.0); 309 SetWindowScale(window_, 1.0);
300 } 310 }
301 311
302 @end 312 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698