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

Side by Side Diff: views/window/window_win.cc

Issue 6546006: Revert 75306 - Force native frames to repaint when OnNCActivate is called. Wi... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
« 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) 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
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 // We need to force a synchronous repaint, otherwise we'll be left in the 857 // If we're not using the native frame, we need to force a synchronous repaint
858 // wrong activation state until something else causes a repaint later. 858 // otherwise we'll be left in the wrong activation state until something else
859 // Both the native and non-native frames may render activation-state 859 // causes a repaint later.
860 // dependent UI. 860 if (!non_client_view_->UseNativeFrame()) {
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 }
868 } 869 }
869 870
870 // If we're active again, we should be allowed to render as inactive, so 871 // If we're active again, we should be allowed to render as inactive, so
871 // tell the non-client view. This must be done independently of the check for 872 // tell the non-client view. This must be done independently of the check for
872 // disable_inactive_rendering_ since that check is valid even if the frame 873 // disable_inactive_rendering_ since that check is valid even if the frame
873 // is not active, but this can only be done if we've become active. 874 // is not active, but this can only be done if we've become active.
874 if (IsActive()) 875 if (IsActive())
875 non_client_view_->DisableInactiveRendering(false); 876 non_client_view_->DisableInactiveRendering(false);
876 877
877 // Reset the disable inactive rendering state since activation has changed. 878 // Reset the disable inactive rendering state since activation has changed.
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 Window::CloseSecondaryWidget(root_view->GetWidget()); 1654 Window::CloseSecondaryWidget(root_view->GetWidget());
1654 return TRUE; 1655 return TRUE;
1655 } 1656 }
1656 } // namespace 1657 } // namespace
1657 1658
1658 void Window::CloseAllSecondaryWindows() { 1659 void Window::CloseAllSecondaryWindows() {
1659 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0); 1660 EnumThreadWindows(GetCurrentThreadId(), WindowCallbackProc, 0);
1660 } 1661 }
1661 1662
1662 } // namespace views 1663 } // namespace views
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