From the perspective of the user, Aura provides Window and Event types, as well as a set of interfaces to customize their behavior.
The root of a Window hierarchy is the RootWindow. This type is responsible for event dispatch.
An Aura window hierarchy is embedded within a native window provided by the underlying platform (XWindow, HWND). This native window is encapsulated in a RootWindowHost implementation for that specific platform. This host receives native events from the underlying system, cracks them into aura::Event subclasses and sends them to the RootWindow for dispatch.
In many ways the Aura architecture mimics that of Views, though it is a little simpler.
Event Flow
This diagram shows the flow of events through each stage of the Aura system.
The RootWindowHost receives a base::NativeEvent (MSG/XEvent*) from the underlying platform.
The RootWindowHost cracks this message to an aura::Event* type and forwards it to the RootWindow for further processing and dispatch.
Depending on the event type, a target window for event dispatch is determined for the event. See notes on dispatch below.
Every registered aura::EventFilter* from the target window up to and including the RootWindow is given an opportunity to pre-handle the event. An EventFilter implementation will return true if it wants to consume the event and stop further processing. EventFilter is a powerful API to intercept events before the target Window gets a chance to handle them. It can be used by a client to implement features like window movement, modality, and so on.
Finally if no EventFilter intercepts the event, it is passed directly to the target window's delegate. The Window itself never sees the event directly, since window customization in Aura is done entirely through delegate interfaces like EventFilter, WindowDelegate, etc.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~