From 863cab911d2d71e4d55cc961110d0f297bb0aa78 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Fri, 24 Jul 2009 00:05:51 +0000 Subject: Fix Omnibox cursor flicker by deleting a bunch of useless code in WindowWin. I tested running the app in Vista non-Aero, and I still got resize cursors on all edges and was able to resize the window. BUG=13926 TEST=Mouse around on the omnibox; the cursor should not flicker. Review URL: http://codereview.chromium.org/159245 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21485 0039d316-1c4b-4281-b951-d872f2087c98 --- views/window/window_win.cc | 41 ----------------------------------------- views/window/window_win.h | 1 - 2 files changed, 42 deletions(-) (limited to 'views/window') diff --git a/views/window/window_win.cc b/views/window/window_win.cc index 871e132c..13f0529 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -972,47 +972,6 @@ LRESULT WindowWin::OnNCUAHDrawFrame(UINT msg, WPARAM w_param, return 0; } -LRESULT WindowWin::OnSetCursor(HWND window, UINT hittest_code, UINT message) { - // If the window is disabled, it's because we're showing a modal dialog box. - // We need to let DefWindowProc handle the message. That's because - // DefWindowProc for WM_SETCURSOR with message = some kind of mouse button - // down message sends the top level window a WM_ACTIVATEAPP message, which we - // otherwise wouldn't get. The symptom of not doing this is that if the user - // has a window in the background with a modal dialog open, they can't click - // on the disabled background window to bring the entire stack to the front. - // This is annoying because they then have to move all the foreground windows - // out of the way to be able to activate said window. I love how on Windows, - // the answer isn't always logical. - if (!IsWindowEnabled(GetNativeView())) - return WidgetWin::OnSetCursor(window, hittest_code, message); - - int index = RC_NORMAL; - switch (hittest_code) { - case HTTOP: - case HTBOTTOM: - index = RC_VERTICAL; - break; - case HTTOPLEFT: - case HTBOTTOMRIGHT: - index = RC_NWSE; - break; - case HTTOPRIGHT: - case HTBOTTOMLEFT: - index = RC_NESW; - break; - case HTLEFT: - case HTRIGHT: - index = RC_HORIZONTAL; - break; - case HTCAPTION: - case HTCLIENT: - index = RC_NORMAL; - break; - } - SetCursor(resize_cursors_[index]); - return 0; -} - 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 5f6a07b..96bed16 100644 --- a/views/window/window_win.h +++ b/views/window/window_win.h @@ -128,7 +128,6 @@ class WindowWin : public WidgetWin, virtual void OnRButtonUp(UINT ht_component, const CPoint& point); virtual LRESULT OnNCUAHDrawCaption(UINT msg, WPARAM w_param, LPARAM l_param); virtual LRESULT OnNCUAHDrawFrame(UINT msg, WPARAM w_param, LPARAM l_param); - virtual LRESULT OnSetCursor(HWND window, UINT hittest_code, UINT message); 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); -- cgit v1.1