diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-09 18:35:07 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-09 18:35:07 +0000 |
commit | 9258adb7f3d43f027a72fd1ac2e1858952e9f658 (patch) | |
tree | 74b685a67e56694faf764a0aec9b553e79eb61ce /chrome | |
parent | 8deeb95696562494db58140a46fbe06432f39d57 (diff) | |
download | chromium_src-9258adb7f3d43f027a72fd1ac2e1858952e9f658.zip chromium_src-9258adb7f3d43f027a72fd1ac2e1858952e9f658.tar.gz chromium_src-9258adb7f3d43f027a72fd1ac2e1858952e9f658.tar.bz2 |
Another attempt at fixing standard non-client area overpainting.
http://crbug.com/3264
Review URL: http://codereview.chromium.org/7022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/views/custom_frame_window.cc | 21 | ||||
-rw-r--r-- | chrome/views/custom_frame_window.h | 3 | ||||
-rw-r--r-- | chrome/views/hwnd_view_container.h | 4 |
3 files changed, 20 insertions, 8 deletions
diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc index 9372334..f2d7bea 100644 --- a/chrome/views/custom_frame_window.cc +++ b/chrome/views/custom_frame_window.cc @@ -911,16 +911,17 @@ void CustomFrameWindow::SizeWindowToDefault() { /////////////////////////////////////////////////////////////////////////////// // CustomFrameWindow, HWNDViewContainer overrides: +void CustomFrameWindow::OnEnterIdle(UINT reason, HWND window) { + ScopedVisibilityRemover remover(GetHWND()); + DefWindowProc(GetHWND(), WM_ENTERIDLE, reason, + reinterpret_cast<LPARAM>(window)); +} + static void EnableMenuItem(HMENU menu, UINT command, bool enabled) { UINT flags = MF_BYCOMMAND | (enabled ? MF_ENABLED : MF_DISABLED | MF_GRAYED); EnableMenuItem(menu, command, flags); } -void CustomFrameWindow::OnEnterMenuLoop(bool is_track_popup_menu) { - ScopedVisibilityRemover remover(GetHWND()); - DefWindowProc(GetHWND(), WM_ENTERMENULOOP, is_track_popup_menu, NULL); -} - void CustomFrameWindow::OnInitMenu(HMENU menu) { bool minimized = IsMinimized(); bool maximized = IsMaximized(); @@ -935,6 +936,16 @@ void CustomFrameWindow::OnInitMenu(HMENU menu) { window_delegate()->CanMaximize() && !maximized); EnableMenuItem(menu, SC_MINIMIZE, window_delegate()->CanMaximize() && !minimized); + + ScopedVisibilityRemover remover(GetHWND()); + DefWindowProc(GetHWND(), WM_INITMENU, reinterpret_cast<WPARAM>(menu), NULL); +} + +void CustomFrameWindow::OnInitMenuPopup(HMENU menu, UINT position, + BOOL is_system_menu) { + ScopedVisibilityRemover remover(GetHWND()); + DefWindowProc(GetHWND(), WM_INITMENUPOPUP, reinterpret_cast<WPARAM>(menu), + MAKELPARAM(is_system_menu, position)); } void CustomFrameWindow::OnMouseLeave() { diff --git a/chrome/views/custom_frame_window.h b/chrome/views/custom_frame_window.h index 2682d17..0d89193 100644 --- a/chrome/views/custom_frame_window.h +++ b/chrome/views/custom_frame_window.h @@ -48,8 +48,9 @@ class CustomFrameWindow : public Window { virtual void DisableInactiveRendering(bool disable); // Overridden from HWNDViewContainer: - virtual void OnEnterMenuLoop(bool is_track_popup_menu); + virtual void OnEnterIdle(UINT reason, HWND window); virtual void OnInitMenu(HMENU menu); + virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); virtual void OnMouseLeave(); virtual LRESULT OnNCActivate(BOOL active); virtual LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); diff --git a/chrome/views/hwnd_view_container.h b/chrome/views/hwnd_view_container.h index cd87f68..70f255b 100644 --- a/chrome/views/hwnd_view_container.h +++ b/chrome/views/hwnd_view_container.h @@ -191,7 +191,7 @@ class HWNDViewContainer : public ViewContainer, MSG_WM_DESTROY(OnDestroy) MSG_WM_ERASEBKGND(OnEraseBkgnd) MSG_WM_ENDSESSION(OnEndSession) - MSG_WM_ENTERMENULOOP(OnEnterMenuLoop) + MSG_WM_ENTERIDLE(OnEnterIdle) MSG_WM_EXITMENULOOP(OnExitMenuLoop) MSG_WM_GETMINMAXINFO(OnGetMinMaxInfo) MSG_WM_HSCROLL(OnHScroll) @@ -359,7 +359,7 @@ class HWNDViewContainer : public ViewContainer, // leak a few things. virtual void OnDestroy(); virtual void OnEndSession(BOOL ending, UINT logoff) { SetMsgHandled(FALSE); } - virtual void OnEnterMenuLoop(BOOL is_track_popup_menu) { + virtual void OnEnterIdle(UINT reason, HWND window) { SetMsgHandled(FALSE); } virtual void OnExitMenuLoop(BOOL is_track_popup_menu) { SetMsgHandled(FALSE); } |