OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "views/window/window_win.h" | 5 #include "views/window/window_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
847 } | 847 } |
848 } | 848 } |
849 | 849 |
850 if (process_mouse_exited) | 850 if (process_mouse_exited) |
851 ProcessMouseExited(); | 851 ProcessMouseExited(); |
852 } | 852 } |
853 | 853 |
854 LRESULT WindowWin::OnNCActivate(BOOL active) { | 854 LRESULT WindowWin::OnNCActivate(BOOL active) { |
855 is_active_ = !!active; | 855 is_active_ = !!active; |
856 | 856 |
857 // If we're not using the native frame, we need to force a synchronous repaint | 857 // We need to force a synchronous repaint, otherwise we'll be left in the |
858 // otherwise we'll be left in the wrong activation state until something else | 858 // wrong activation state until something else causes a repaint later. |
859 // causes a repaint later. | 859 // The native frame needs a repaint as well, in case a profile menu is being |
860 if (!non_client_view_->UseNativeFrame()) { | 860 // displayed. |
Ben Goodger (Google)
2011/02/17 17:22:09
Please rewrite the last sentence as:
Both the nat
| |
861 // We can get WM_NCACTIVATE before we're actually visible. If we're not | 861 // We can get WM_NCACTIVATE before we're actually visible. If we're not |
862 // visible, no need to paint. | 862 // visible, no need to paint. |
863 if (IsWindowVisible(GetNativeView())) { | 863 if (IsWindowVisible(GetNativeView())) { |
864 non_client_view_->SchedulePaint(); | 864 non_client_view_->SchedulePaint(); |
865 // We need to force a paint now, as a user dragging a window will block | 865 // We need to force a paint now, as a user dragging a window will block |
866 // painting operations while the move is in progress. | 866 // painting operations while the move is in progress. |
867 PaintNow(root_view_->GetScheduledPaintRect()); | 867 PaintNow(root_view_->GetScheduledPaintRect()); |
868 } | |
869 } | 868 } |
870 | 869 |
871 // If we're active again, we should be allowed to render as inactive, so | 870 // If we're active again, we should be allowed to render as inactive, so |
872 // tell the non-client view. This must be done independently of the check for | 871 // tell the non-client view. This must be done independently of the check for |
873 // disable_inactive_rendering_ since that check is valid even if the frame | 872 // disable_inactive_rendering_ since that check is valid even if the frame |
874 // is not active, but this can only be done if we've become active. | 873 // is not active, but this can only be done if we've become active. |
875 if (IsActive()) | 874 if (IsActive()) |
876 non_client_view_->DisableInactiveRendering(false); | 875 non_client_view_->DisableInactiveRendering(false); |
877 | 876 |
878 // Reset the disable inactive rendering state since activation has changed. | 877 // Reset the disable inactive rendering state since activation has changed. |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1654 Window::CloseSecondaryWidget(root_view->GetWidget()); | 1653 Window::CloseSecondaryWidget(root_view->GetWidget()); |
1655 return TRUE; | 1654 return TRUE; |
1656 } | 1655 } |
1657 } // namespace | 1656 } // namespace |
1658 | 1657 |
1659 void Window::CloseAllSecondaryWindows() { | 1658 void Window::CloseAllSecondaryWindows() { |
1660 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); | 1659 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); |
1661 } | 1660 } |
1662 | 1661 |
1663 } // namespace views | 1662 } // namespace views |
OLD | NEW |