• Brian Liu Xu's avatar
    Ignore rogue window management mouse move events · 933ec987
    Brian Liu Xu authored
    Do not process window management mouse messages (WMMMs) when the pen is active over the client area.
    
    Windows sends window management mouse messages at the mouse position when windows open or close (e.g. Aura tooltips and Status Bubbles), including WM_MOUSEMOVE, WM_NCMOUSEMOVE, and WM_SETCURSOR. This is a longstanding Windows behavior designed to ensure that mouse cursor visuals and hover states update when the foreground window changes. However, this behavior does not extend to pen input, so WMMMs always come with the mouse coordinates instead of with the pen coordinates even if there is an active pen.
    
    In Chromium, WM_POINTER processing in the window non-client area are "promoted" to mouse messages in order to allow for interaction with the native window frame (e.g. resize handles, title bar, and window caption buttons). However, WM_POINTER messages in the window client area are handled as Chromium events without any mouse promotion; in this latter case, mouse position and pen position are not guaranteed to be in sync.
    
    Since Aura tooltips and Status Bubbles appear as custom windows on pen hover, opening/closing them causes Windows to send WMMMs. Consequently, users might see visual flickering as hover states flip back and forth between pen and mouse positions. In order to ensure that these WMMMs do not interfere with hover states, we must ignore such messages until the pen is no longer active.
    
    This change affects only Windows 8 and newer clients, which use the WM_POINTER API.
    
    Bug: 1147222
    Change-Id: I44335348f933f48edcfe665b396f133388169957
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2525220
    Commit-Queue: Brian Liu Xu <brx@microsoft.com>
    Auto-Submit: Brian Liu Xu <brx@microsoft.com>
    Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#825665}
    933ec987
hwnd_message_handler.h 33.6 KB