diff options
-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; |