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

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 2899053007: Don't do DefWindowProc on WM_NCACTIVATE if there's no frame. (Closed)
Patch Set: add comment Created 3 years, 6 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 | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/win/hwnd_message_handler.h" 5 #include "ui/views/win/hwnd_message_handler.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <tchar.h> 10 #include <tchar.h>
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 RDW_NOCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW); 1812 RDW_NOCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW);
1813 EnumChildWindows(hwnd(), EnumChildWindowsForRedraw, NULL); 1813 EnumChildWindows(hwnd(), EnumChildWindowsForRedraw, NULL);
1814 } 1814 }
1815 1815
1816 // The frame may need to redraw as a result of the activation change. 1816 // The frame may need to redraw as a result of the activation change.
1817 // We can get WM_NCACTIVATE before we're actually visible. If we're not 1817 // We can get WM_NCACTIVATE before we're actually visible. If we're not
1818 // visible, no need to paint. 1818 // visible, no need to paint.
1819 if (IsVisible()) 1819 if (IsVisible())
1820 delegate_->SchedulePaint(); 1820 delegate_->SchedulePaint();
1821 1821
1822 if (delegate_->GetFrameMode() == FrameMode::CUSTOM_DRAWN) { 1822 // Calling DefWindowProc is only necessary if there's a system frame being
1823 // drawn. Otherwise it can draw an incorrect title bar and cause visual
1824 // corruption.
1825 if (!delegate_->HasFrame() ||
1826 delegate_->GetFrameMode() == FrameMode::CUSTOM_DRAWN) {
1823 SetMsgHandled(TRUE); 1827 SetMsgHandled(TRUE);
1824 return TRUE; 1828 return TRUE;
1825 } 1829 }
1826 1830
1827 return DefWindowProcWithRedrawLock( 1831 return DefWindowProcWithRedrawLock(
1828 WM_NCACTIVATE, render_as_active || active, 0); 1832 WM_NCACTIVATE, render_as_active || active, 0);
1829 } 1833 }
1830 1834
1831 LRESULT HWNDMessageHandler::OnNCCalcSize(BOOL mode, LPARAM l_param) { 1835 LRESULT HWNDMessageHandler::OnNCCalcSize(BOOL mode, LPARAM l_param) {
1832 // We only override the default handling if we need to specify a custom 1836 // We only override the default handling if we need to specify a custom
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
2909 MONITORINFO monitor_info = {sizeof(monitor_info)}; 2913 MONITORINFO monitor_info = {sizeof(monitor_info)};
2910 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), 2914 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY),
2911 &monitor_info); 2915 &monitor_info);
2912 gfx::Rect shrunk_rect(monitor_info.rcMonitor); 2916 gfx::Rect shrunk_rect(monitor_info.rcMonitor);
2913 shrunk_rect.set_height(shrunk_rect.height() - 1); 2917 shrunk_rect.set_height(shrunk_rect.height() - 1);
2914 background_fullscreen_hack_ = true; 2918 background_fullscreen_hack_ = true;
2915 SetBoundsInternal(shrunk_rect, false); 2919 SetBoundsInternal(shrunk_rect, false);
2916 } 2920 }
2917 2921
2918 } // namespace views 2922 } // 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