Ensure window border icons repaint when DWM is enabled
When the user movers the cursor over the minimize/maximize/close
buttons, DWM paints them in a hover state. If the user subsequently
moves the cursor out of the window, DWM was not repainting the icons
with the unhovered state because Chrome ate the WM_NCMOUSELEAVE
message.This change notifies DWM of the exit.
BUG=637114
TEST=Unmaximize Chrome. Hover Red-X at top right. Fling mouse upward.
R=sky@chromium.org
Review-Url: https://codereview.chromium.org/2244263002
Cr-Commit-Position: refs/heads/master@{#412541}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index ab5b7ab..ec631af 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -2652,8 +2652,13 @@
break;
}
- case WM_NCMOUSELEAVE:
+ case WM_NCMOUSELEAVE: {
+ // If the DWM is rendering the window controls, we need to give the DWM's
+ // default window procedure the chance to repaint the window border icons
+ if (HasSystemFrame())
+ handled = DwmDefWindowProc(hwnd(), WM_NCMOUSELEAVE, 0, 0, NULL) != 0;
break;
+ }
default:
left_button_down_on_caption_ = false;