Commit 44d3f51e authored by msw@chromium.org's avatar msw@chromium.org

Restore NativeWidgetWin::OnSetIcon to eliminate classic theme titlebar flickering.

OnSetIcon (and OnSetText) were removed in crrev.com/111858.
That was a speculative fix for crbug.com/97808.

DefWindowProc for WM_SETICON does weird non-client painting.
We need a ScopedRedrawLock to avoid flickering on title/icon updates.

TEST=No Windows classic theme titlebar flickering.
BUG=97808,140674

Review URL: https://chromiumcodereview.appspot.com/10826160

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150104 0039d316-1c4b-4281-b951-d872f2087c98
parent 22add5a9
......@@ -2006,9 +2006,14 @@ void NativeWidgetWin::OnSetFocus(HWND old_focused_window) {
SetMsgHandled(FALSE);
}
LRESULT NativeWidgetWin::OnSetIcon(UINT size_type, HICON new_icon) {
// Use a ScopedRedrawLock to avoid weird non-client painting.
return DefWindowProcWithRedrawLock(WM_SETICON, size_type,
reinterpret_cast<LPARAM>(new_icon));
}
LRESULT NativeWidgetWin::OnSetText(const wchar_t* text) {
// DefWindowProc for WM_SETTEXT does weird non-client painting, so we need to
// call it inside a ScopedRedrawLock.
// Use a ScopedRedrawLock to avoid weird non-client painting.
return DefWindowProcWithRedrawLock(WM_SETTEXT, NULL,
reinterpret_cast<LPARAM>(text));
}
......
......@@ -361,6 +361,7 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl,
MSG_WM_PAINT(OnPaint)
MSG_WM_POWERBROADCAST(OnPowerBroadcast)
MSG_WM_SETFOCUS(OnSetFocus)
MSG_WM_SETICON(OnSetIcon)
MSG_WM_SETTEXT(OnSetText)
MSG_WM_SETTINGCHANGE(OnSettingChange)
MSG_WM_SIZE(OnSize)
......@@ -427,6 +428,7 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl,
virtual LRESULT OnReflectedMessage(UINT msg, WPARAM w_param, LPARAM l_param);
virtual LRESULT OnSetCursor(UINT message, WPARAM w_param, LPARAM l_param);
virtual void OnSetFocus(HWND old_focused_window);
virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon);
virtual LRESULT OnSetText(const wchar_t* text);
virtual void OnSettingChange(UINT flags, const wchar_t* section);
virtual void OnSize(UINT param, const CSize& size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment