refactor(core/policy): 从 policy_context_t 中提取 event 为独立参数

policy_context_t 应该只包含所有 policy 相关接口都需要用到的参数,而
event 只是 policy_route_event 接口需要的参数,故应该将其从
policy_context_t 中剔除
This commit is contained in:
2026-04-18 22:24:03 +08:00
parent 998b22a288
commit 38d2a28438
3 changed files with 28 additions and 12 deletions

View File

@@ -93,13 +93,17 @@ static bool route_map_request(
return true;
}
bool policy_route_event(const policy_context_t *ctx, command_buffer_t *out) {
switch (ctx->event->type) {
bool policy_route_event(
const policy_context_t *ctx,
const event_t *event,
command_buffer_t *out
) {
switch (event->type) {
case ZDWM_EVENT_WINDOW_MAP_REQUEST:
return route_map_request(
ctx->state,
ctx->rules,
&ctx->event->as.window_map_request,
&event->as.window_map_request,
out
);
default: