OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |