Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix strange touch behavior on Windows titlebar.
This patch fixes three bugs: * Dragging the window via finger touch on the titlebar only works about 50% of the time. * Touching the custom titlebar caption buttons would "leak" to the window underneath, if the top window was closed or minimized. * Touching and dragging the custom titlebar caption buttons would cause further touch input on other widgets (like popup bubbles) to not work. This patch fixes them all at once by revising how we handle mouse events synthesized from touch: * We were letting all mouse events synthesized from touch fall through as regular mouse events, unless they were targeted at HTCLIENT. They would cause problems like setting mouse capture incorrectly (causing bug #3) and cause double inputs (bug #2). This patch instead marks these events as handled and ignores them, unless otherwise noted below. * We now DefWindowProc events targeted at HTCAPTION and HTSYSMENU instead of simply ignoring them, which fixes bug #1. Our special drag handling in HandleMouseInputForCaption works poorly for touch. * We also DefWindowProc events targeted at the caption buttons when custom titlebar is off, which is required for them to work. * When we do the hittest for the above targeting, we no longer convert LPARAM to window coordinates before sending WM_NCHITTEST, because the point should remain in screen coordinates. This was causing all three bugs to reproduce inconsistently, since we would sometimes get HTCLIENT or HTNOWHERE for events clearly targeting non-client area. This patch doesn't specifically address the broken pen touch case, but as a side effect it makes dragging the window with the pen work slightly more often. Bug: 838870, 832291, 843486 Change-Id: Ie7d339f7b1b75acb14377d8411234d8faa16755f Reviewed-on: https://chromium-review.googlesource.com/1048877 Commit-Queue: Bret Sepulveda <bsep@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#560353}
- Loading branch information