crosvm/gpu_display
Pujun Lun eb3b49f185 gpu_display: better detection for window sizing/moving modal loop.
We do receive WM_ENTERSIZEMOVE when the window is about to be resized or
moved, but it doesn't tell us whether resizing or moving should be
expected. We won't know that until later we receive WM_SIZING or
WM_MOVING. There are also corner cases where we don't receive either
WM_SIZING or WM_MOVING in the modal loop, or receive both of them.

This CL adds an enum SizeMoveLoopState to track this state, so that we
can know whether the window is resizing or moving.

One alternative is to use WM_NCHITTEST to test whether the cursor is on
the window title bar (which implies moving the window) or window
borders/corners (which implies resizing) when WM_ENTERSIZEMOVE is
received. However, the user may also trigger resizing/moving from the
system menu (e.g. by right-clicking on the title bar and selecting it
from the drop down list), so this is not always reliable.

BUG=b:254702853
TEST=Tested in the Windows downstream

Change-Id: I8c8d97a7542b291c57dbddb75d785b324ff2776e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3975933
Commit-Queue: Pujun Lun <lunpujun@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-10-24 20:21:57 +00:00
..
examples Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
protocol health-check: Add check for newline at ends of files 2022-08-18 00:17:04 +00:00
src gpu_display: better detection for window sizing/moving modal loop. 2022-10-24 20:21:57 +00:00
build.rs Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
Cargo.toml gpu_display: upstream Windows implementation 2022-09-16 17:36:57 +00:00