summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 17:16:12 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-06 17:16:12 +0000
commit44d3f51e45ac2b09d3ff582db8d147df3e088473 (patch)
tree265fc8bb38ddf7e915e69819379a74f62bda1e72
parent22add5a98ed770576cca2eab6f7fbcc309ed71b0 (diff)
downloadchromium_src-44d3f51e45ac2b09d3ff582db8d147df3e088473.zip
chromium_src-44d3f51e45ac2b09d3ff582db8d147df3e088473.tar.gz
chromium_src-44d3f51e45ac2b09d3ff582db8d147df3e088473.tar.bz2
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
-rw-r--r--ui/views/widget/native_widget_win.cc9
-rw-r--r--ui/views/widget/native_widget_win.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index 6c65886..c6d735f 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -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));
}
diff --git a/ui/views/widget/native_widget_win.h b/ui/views/widget/native_widget_win.h
index f0cbfbd..0062132 100644
--- a/ui/views/widget/native_widget_win.h
+++ b/ui/views/widget/native_widget_win.h
@@ -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);