From 3031adf3cb924a56017278ef39393416a85d8d58 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Thu, 7 May 2026 02:22:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(policy):=20=E5=A4=84=E7=90=86=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/policy.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/core/policy.c b/src/core/policy.c index fc463e5..ad42a9f 100644 --- a/src/core/policy.c +++ b/src/core/policy.c @@ -205,6 +205,25 @@ static void route_window_activate_request( } } +static void route_window_state_request( + state_t *state, + const window_state_request_event_t *e, + command_buffer_t *out +) { + auto window = state_window_get(state, e->window); + if (!window) return; + + command_t change_window_state_cmd = { + .type = ZDWM_COMMAND_CHANGE_WINDOW_STATE, + .as.state_change = { + .type = e->type, + .window = e->window, + .action = e->action, + } + }; + command_buffer_push(out, &change_window_state_cmd); +} + static void route_configure_request( state_t *state, const configure_data_t *data, @@ -262,6 +281,9 @@ void policy_route_event( auto data = &event->as.window_activate_request; route_window_activate_request(state, data, out); } break; + case ZDWM_EVENT_WINDOW_STATE_REQUEST: + route_window_state_request(state, &event->as.window_state_request, out); + break; case ZDWM_EVENT_CONFIGURE_REQUEST: { auto data = &event->as.configure_request; route_configure_request(state, data, ctx->layouts, out);