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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/constrained_window/constrained_window_animation.mm
diff --git a/ui/base/cocoa/constrained_window/constrained_window_animation.mm b/ui/base/cocoa/constrained_window/constrained_window_animation.mm
index 3618a1b97825fc36365861ab3d3928d170cb3f2b..e467e0c85d4c95dedf81075250dfc1650a193336 100644
--- a/ui/base/cocoa/constrained_window/constrained_window_animation.mm
+++ b/ui/base/cocoa/constrained_window/constrained_window_animation.mm
@@ -223,6 +223,16 @@ void UpdateWindowShowHideAnimationState(NSWindow* window, CGFloat value) {
if (progress >= 1.0) {
[self setWindowStateForEnd];
+
+ // Starting in 10.10, the WindowServer forgets to draw the shadow on windows
+ // that animate in this way on retina screens. -[NSWindow invalidateShadow]
+ // doesn't fix it. Neither does toggling -setHasShadow:. But forcing an
+ // update to the window size, and then undoing it, seems to fix the problem.
+ // See http://crbug.com/436884.
+ // TODO(tapted): Find a better fix (this is horrible).
+ NSRect frame = [window_ frame];
+ [window_ setFrame:NSInsetRect(frame, 1, 1) display:NO animate:NO];
+ [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
return;
}
[self setWindowStateForValue:[self currentValue]];
« 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