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>
2 files changed
tree: 0366a9d241b230296422e116972658f50d767b0b
  1. .cargo/
  2. .devcontainer/
  3. .github/
  4. .vscode/
  5. aarch64/
  6. acpi_tables/
  7. anti_tamper/
  8. arch/
  9. argh_helpers/
  10. base/
  11. bit_field/
  12. broker_ipc/
  13. common/
  14. crash_report/
  15. cros_async/
  16. cros_fdt/
  17. cros_tracing/
  18. crosvm-fuzz/
  19. crosvm_cli/
  20. crosvm_control/
  21. crosvm_plugin/
  22. devices/
  23. disk/
  24. docs/
  25. fuse/
  26. gpu_display/
  27. hypervisor/
  28. infra/
  29. integration_tests/
  30. io_uring/
  31. kernel_cmdline/
  32. kernel_loader/
  33. kvm/
  34. kvm_sys/
  35. libcras_stub/
  36. linux_input_sys/
  37. logo/
  38. media/
  39. metrics/
  40. net_sys/
  41. net_util/
  42. power_monitor/
  43. prebuilts/
  44. protos/
  45. qcow_utils/
  46. resources/
  47. rutabaga_gfx/
  48. sandbox/
  49. seccomp/
  50. serde_keyvalue/
  51. src/
  52. system_api/
  53. tests/
  54. third_party/
  55. tools/
  56. tpm2/
  57. tpm2-sys/
  58. tube_transporter/
  59. usb_sys/
  60. usb_util/
  61. vfio_sys/
  62. vhost/
  63. virtio_sys/
  64. vm_control/
  65. vm_memory/
  66. win_audio/
  67. win_util/
  68. x86_64/
  69. .dockerignore
  70. .gitignore
  71. .gitmodules
  72. .rustfmt.toml
  73. ARCHITECTURE.md
  74. build.rs
  75. Cargo.lock
  76. Cargo.toml
  77. CONTRIBUTING.md
  78. DIR_METADATA
  79. LICENSE
  80. mypy.ini
  81. OWNERS
  82. PRESUBMIT.cfg
  83. pyproject.toml
  84. README.chromeos.md
  85. README.md
  86. rust-toolchain
README.md

crosvm - The Chrome OS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on Chrome OS devices.

Logo