diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-17 14:27:09 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-17 14:27:09 +0000 |
commit | 2cfc4b145353926e5d5a308b979b6e26e10c8392 (patch) | |
tree | d806180cb387e0ccf114dc707792dc910288fb7d /views | |
parent | b867d06a88bf605f786f12bc06b423859722b58f (diff) | |
download | chromium_src-2cfc4b145353926e5d5a308b979b6e26e10c8392.zip chromium_src-2cfc4b145353926e5d5a308b979b6e26e10c8392.tar.gz chromium_src-2cfc4b145353926e5d5a308b979b6e26e10c8392.tar.bz2 |
Fixes more default non-client frame painting.
http://crbug.com/22704
TEST=see bug
Review URL: http://codereview.chromium.org/7030025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85628 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_win.cc | 5 | ||||
-rw-r--r-- | views/widget/widget_win.h | 2 | ||||
-rw-r--r-- | views/window/window_win.cc | 14 | ||||
-rw-r--r-- | views/window/window_win.h | 3 |
4 files changed, 20 insertions, 4 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index 67166ff..460fa5d 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -873,6 +873,11 @@ LRESULT WidgetWin::OnReflectedMessage(UINT msg, return 0; } +LRESULT WidgetWin::OnSetCursor(UINT message, WPARAM w_param, LPARAM l_param) { + SetMsgHandled(FALSE); + return 0; +} + void WidgetWin::OnSetFocus(HWND focused_window) { delegate_->OnNativeFocus(focused_window); if (input_method_.get()) diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index d013ddb..c659b61 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -244,6 +244,7 @@ class WidgetWin : public ui::WindowImpl, MESSAGE_HANDLER_EX(WM_MOUSEACTIVATE, OnMouseActivate) MESSAGE_HANDLER_EX(WM_MOUSELEAVE, OnMouseRange) MESSAGE_HANDLER_EX(WM_NCMOUSELEAVE, OnMouseRange) + MESSAGE_HANDLER_EX(WM_SETCURSOR, OnSetCursor); // Key events. MESSAGE_HANDLER_EX(WM_KEYDOWN, OnKeyEvent) @@ -358,6 +359,7 @@ class WidgetWin : public ui::WindowImpl, virtual void OnPaint(HDC dc); virtual LRESULT OnPowerBroadcast(DWORD power_event, DWORD data); 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 focused_window); virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon); virtual LRESULT OnSetText(const wchar_t* text); diff --git a/views/window/window_win.cc b/views/window/window_win.cc index 621af5a..fd655a6 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -515,19 +515,17 @@ LRESULT WindowWin::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { SetMouseCapture(); } - /* TODO(beng): Fix the standard non-client over-painting bug. This code - doesn't work but identifies the problem. - if (message == WM_NCLBUTTONDOWN && !IsMsgHandled()) { + if (message == WM_NCLBUTTONDOWN) { // WindowWin::OnNCLButtonDown set the message as unhandled. This normally // means WidgetWin::ProcessWindowMessage will pass it to // DefWindowProc. Sadly, DefWindowProc for WM_NCLBUTTONDOWN does weird // non-client painting, so we need to call it directly here inside a // scoped update lock. ScopedRedrawLock lock(this); + WidgetWin::OnMouseRange(message, w_param, l_param); DefWindowProc(GetNativeView(), WM_NCLBUTTONDOWN, w_param, l_param); SetMsgHandled(TRUE); } - */ WidgetWin::OnMouseRange(message, w_param, l_param); return 0; @@ -705,6 +703,14 @@ LRESULT WindowWin::OnNCUAHDrawFrame(UINT msg, WPARAM w_param, return 0; } +LRESULT WindowWin::OnSetCursor(UINT msg, + WPARAM w_param, + LPARAM l_param) { + // This shouldn't hurt even if we're using the native frame. + ScopedRedrawLock lock(this); + return DefWindowProc(GetNativeView(), msg, w_param, l_param); +} + LRESULT WindowWin::OnSetIcon(UINT size_type, HICON new_icon) { // This shouldn't hurt even if we're using the native frame. ScopedRedrawLock lock(this); diff --git a/views/window/window_win.h b/views/window/window_win.h index 71f2273..5270034 100644 --- a/views/window/window_win.h +++ b/views/window/window_win.h @@ -120,6 +120,9 @@ class WindowWin : public WidgetWin, virtual LRESULT OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param) OVERRIDE; + virtual LRESULT OnSetCursor(UINT message, + WPARAM w_param, + LPARAM l_param) OVERRIDE; virtual LRESULT OnSetIcon(UINT size_type, HICON new_icon) OVERRIDE; virtual LRESULT OnSetText(const wchar_t* text) OVERRIDE; virtual void OnSettingChange(UINT flags, const wchar_t* section) OVERRIDE; |