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/views/cocoa/bridged_native_widget.mm

Issue 2336983002: MacViews: Trigger shadow invalidation when a translucent window is shown. (Closed)
Patch Set: Remove patch dependency. Created 4 years, 3 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 | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/views/cocoa/bridged_native_widget.h" 5 #import "ui/views/cocoa/bridged_native_widget.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 // asynchronous (and things like deminiaturize in AppKit are not), it can 834 // asynchronous (and things like deminiaturize in AppKit are not), it can
835 // result in a CALayer appearing on screen before it has been redrawn in the 835 // result in a CALayer appearing on screen before it has been redrawn in the
836 // GPU process. This is a general problem. In content, a helper class, 836 // GPU process. This is a general problem. In content, a helper class,
837 // RenderWidgetResizeHelper, blocks the UI thread in -[NSView setFrameSize:] 837 // RenderWidgetResizeHelper, blocks the UI thread in -[NSView setFrameSize:]
838 // and RenderWidgetHostView::Show() until a frame is ready. 838 // and RenderWidgetHostView::Show() until a frame is ready.
839 if (layer()) { 839 if (layer()) {
840 layer()->SetVisible(window_visible_); 840 layer()->SetVisible(window_visible_);
841 layer()->SchedulePaint(gfx::Rect(GetClientAreaSize())); 841 layer()->SchedulePaint(gfx::Rect(GetClientAreaSize()));
842 } 842 }
843 843
844 // For translucent windows which are made visible, recalculate shadow when the
tapted 2016/09/15 04:12:26 this probably belongs in the if (layer()) block ab
karandeepb 2016/09/15 06:30:10 Done. I probably need to do this for the initial_v
tapted 2016/09/15 06:37:41 The most concrete answer is that there are tests t
845 // frame from the compositor arrives.
846 if (![window_ isOpaque])
847 invalidate_shadow_on_frame_swap_ = window_visible_;
848
844 NotifyVisibilityChangeDown(); 849 NotifyVisibilityChangeDown();
845 850
846 native_widget_mac_->GetWidget()->OnNativeWidgetVisibilityChanged( 851 native_widget_mac_->GetWidget()->OnNativeWidgetVisibilityChanged(
847 window_visible_); 852 window_visible_);
848 853
849 // Toolkit-views suppresses redraws while not visible. To prevent Cocoa asking 854 // Toolkit-views suppresses redraws while not visible. To prevent Cocoa asking
850 // for an "empty" draw, disable auto-display while hidden. For example, this 855 // for an "empty" draw, disable auto-display while hidden. For example, this
851 // prevents Cocoa drawing just *after* a minimize, resulting in a blank window 856 // prevents Cocoa drawing just *after* a minimize, resulting in a blank window
852 // represented in the deminiaturize animation. 857 // represented in the deminiaturize animation.
853 [window_ setAutodisplay:window_visible_]; 858 [window_ setAutodisplay:window_visible_];
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 [bridged_view_ setMouseDownCanMoveWindow:draggable]; 1389 [bridged_view_ setMouseDownCanMoveWindow:draggable];
1385 // AppKit will not update its cache of mouseDownCanMoveWindow unless something 1390 // AppKit will not update its cache of mouseDownCanMoveWindow unless something
1386 // changes. Previously we tried adding an NSView and removing it, but for some 1391 // changes. Previously we tried adding an NSView and removing it, but for some
1387 // reason it required reposting the mouse-down event, and didn't always work. 1392 // reason it required reposting the mouse-down event, and didn't always work.
1388 // Calling the below seems to be an effective solution. 1393 // Calling the below seems to be an effective solution.
1389 [window_ setMovableByWindowBackground:NO]; 1394 [window_ setMovableByWindowBackground:NO];
1390 [window_ setMovableByWindowBackground:YES]; 1395 [window_ setMovableByWindowBackground:YES];
1391 } 1396 }
1392 1397
1393 } // namespace views 1398 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698