summaryrefslogtreecommitdiffstats
path: root/ui/views
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-13 07:02:01 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-13 07:02:01 +0000
commite13a64de891775f8c6c0937baad1621d1c58805d (patch)
treedb85c5ffbf82beb6bb5ae89c9d6f4008f8018deb /ui/views
parentbeb7782f937bed717c8b869c22b8dc326c1f89dc (diff)
downloadchromium_src-e13a64de891775f8c6c0937baad1621d1c58805d.zip
chromium_src-e13a64de891775f8c6c0937baad1621d1c58805d.tar.gz
chromium_src-e13a64de891775f8c6c0937baad1621d1c58805d.tar.bz2
Limit the WM_SETCURSOR DefWindowProc artifacts workaround.
This is a refinement of http://crrev.com/186306 Only use a ScopedRedrawLock and DefWindowProc as needed. Otherwise, mark the message as unhandled for default handling. ( some WM_SETCURSOR calls don't trigger DefWindowProc artifacts ) This is also a speculative fix for http://crbug.com/181282 ( http://crrev.com/186306 may have regressed performance ) BUG=89820,97808,113127,178600,181282 TEST=No Win7/Vista/XP opaque-frame (classic theme) painting glitches. Potential fix for MPArch.RWHH_WhiteoutDuration UMA perf regression. R=sky@chromium.org,ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/12567010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187803 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r--ui/views/win/hwnd_message_handler.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 6c0d854..520980d 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1817,11 +1817,20 @@ LRESULT HWNDMessageHandler::OnReflectedMessage(UINT message,
LRESULT HWNDMessageHandler::OnSetCursor(UINT message,
WPARAM w_param,
LPARAM l_param) {
- const LRESULT result = DefWindowProcWithRedrawLock(message, w_param, l_param);
- // Invalidate the window to paint over any outdated window regions asap, as
- // using a RedrawLock for WM_SETCURSOR may show content through this window.
- if (delegate_->IsUsingCustomFrame() && !ui::win::IsAeroGlassEnabled())
+ LRESULT result = 0;
+ // Use a ScopedRedrawLock to avoid weird non-client painting for windows with
+ // custom frames when glass is not enabled. Otherwise, default handling is
+ // sufficient and does not produce the weird non-client painting artifacts.
+ if (delegate_->IsUsingCustomFrame() && !ui::win::IsAeroGlassEnabled() &&
+ LOWORD(l_param) >= HTLEFT && LOWORD(l_param) <= HTBOTTOMRIGHT) {
+ // Prevent classic theme custom frame artifacts on these WM_SETCUROR calls.
+ result = DefWindowProcWithRedrawLock(message, w_param, l_param);
+ // Invalidate the window to paint over any outdated window regions asap, as
+ // using a RedrawLock for WM_SETCURSOR may show content through this window.
InvalidateRect(hwnd(), NULL, FALSE);
+ } else {
+ SetMsgHandled(FALSE);
+ }
return result;
}