| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/views/window.h" | 5 #include "chrome/views/window.h" |
| 6 | 6 |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 | 8 |
| 9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 | 782 |
| 783 LRESULT Window::OnNCUAHDrawFrame(UINT msg, WPARAM w_param, | 783 LRESULT Window::OnNCUAHDrawFrame(UINT msg, WPARAM w_param, |
| 784 LPARAM l_param) { | 784 LPARAM l_param) { |
| 785 // See comment in widget_win.h at the definition of WM_NCUAHDRAWCAPTION for | 785 // See comment in widget_win.h at the definition of WM_NCUAHDRAWCAPTION for |
| 786 // an explanation about why we need to handle this message. | 786 // an explanation about why we need to handle this message. |
| 787 SetMsgHandled(!non_client_view_->UseNativeFrame()); | 787 SetMsgHandled(!non_client_view_->UseNativeFrame()); |
| 788 return 0; | 788 return 0; |
| 789 } | 789 } |
| 790 | 790 |
| 791 LRESULT Window::OnSetCursor(HWND window, UINT hittest_code, UINT message) { | 791 LRESULT Window::OnSetCursor(HWND window, UINT hittest_code, UINT message) { |
| 792 // If the window is disabled, it's because we're showing a modal dialog box. |
| 793 // We need to let DefWindowProc handle the message. That's because |
| 794 // DefWindowProc for WM_SETCURSOR with message = some kind of mouse button |
| 795 // down message sends the top level window a WM_ACTIVATEAPP message, which we |
| 796 // otherwise wouldn't get. The symptom of not doing this is that if the user |
| 797 // has a window in the background with a modal dialog open, they can't click |
| 798 // on the disabled background window to bring the entire stack to the front. |
| 799 // This is annoying because they then have to move all the foreground windows |
| 800 // out of the way to be able to activate said window. I love how on Windows, |
| 801 // the answer isn't always logical. |
| 802 if (!IsWindowEnabled(GetHWND())) |
| 803 return WidgetWin::OnSetCursor(window, hittest_code, message); |
| 804 |
| 792 int index = RC_NORMAL; | 805 int index = RC_NORMAL; |
| 793 switch (hittest_code) { | 806 switch (hittest_code) { |
| 794 case HTTOP: | 807 case HTTOP: |
| 795 case HTBOTTOM: | 808 case HTBOTTOM: |
| 796 index = RC_VERTICAL; | 809 index = RC_VERTICAL; |
| 797 break; | 810 break; |
| 798 case HTTOPLEFT: | 811 case HTTOPLEFT: |
| 799 case HTBOTTOMRIGHT: | 812 case HTBOTTOMRIGHT: |
| 800 index = RC_NWSE; | 813 index = RC_NWSE; |
| 801 break; | 814 break; |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 resize_cursors_[RC_VERTICAL] = LoadCursor(NULL, IDC_SIZENS); | 1164 resize_cursors_[RC_VERTICAL] = LoadCursor(NULL, IDC_SIZENS); |
| 1152 resize_cursors_[RC_HORIZONTAL] = LoadCursor(NULL, IDC_SIZEWE); | 1165 resize_cursors_[RC_HORIZONTAL] = LoadCursor(NULL, IDC_SIZEWE); |
| 1153 resize_cursors_[RC_NESW] = LoadCursor(NULL, IDC_SIZENESW); | 1166 resize_cursors_[RC_NESW] = LoadCursor(NULL, IDC_SIZENESW); |
| 1154 resize_cursors_[RC_NWSE] = LoadCursor(NULL, IDC_SIZENWSE); | 1167 resize_cursors_[RC_NWSE] = LoadCursor(NULL, IDC_SIZENWSE); |
| 1155 initialized = true; | 1168 initialized = true; |
| 1156 } | 1169 } |
| 1157 } | 1170 } |
| 1158 | 1171 |
| 1159 } // namespace views | 1172 } // namespace views |
| 1160 | 1173 |
| OLD | NEW |