mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 13:23:08 +00:00
b97f10ef0f
On Windows, we have to create a GUI thread that creates the window and retrieves window messages from the thread-specific message queue created by the system. All host events, such as window resizing and mouse and keyboard events, are sent in the form of window messages. Hence, we created these structs/traits to model it: - `Window`: Owns the handle of one window, and provides helper functions for operating on this window. - `HandleWindowMessage`: A trait implemented by the struct that processes host events. In our case, that is the surface. - `WindowMessageProcessor`: Holds one `Window` object and one `HandleWindowMessage` trait object. We only support one window for now. Once we support multi-windowing, there will be multiple processors. - `WindowMessageDispatcher`: A singleton, responsible for dispatching messages retrieved from the message queue to the targeted processor. - `WindowProcedureThread`: Wraps the GUI thread, retrieves messages from the message queue and forwards them to the dispatcher. It also provides helper functions for other threads to talk to the GUI thread. - `MessageRelayThread`: Relays service messages to the GUI thread. Main difference from other platforms: event devices are imported to the GUI thread, since all host events are processed there. BUG=b:213150276 TEST=presubmit Change-Id: I0aabf6adf8a9ff4b24375e9c7df7625b6f761c7a Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3834009 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Commit-Queue: Pujun Lun <lunpujun@google.com> |
||
---|---|---|
.. | ||
examples | ||
protocol | ||
src | ||
build.rs | ||
Cargo.toml |