From 74b30a5d4bbfac66b4bc6ac82b9be05b62f78a5e Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Tue, 23 Jun 2026 03:24:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(runtime):=20=E4=BF=AE=E5=A4=8D=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=87=BD=E6=95=B0=E4=B8=BA=E7=A9=BA=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E7=AA=97=E5=8F=A3=E6=9C=AA=E8=A2=AB=E5=B8=83=E5=B1=80?= =?UTF-8?q?=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/runtime/runtime.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 9bdbccf..e237b8e 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -303,9 +303,6 @@ static const layout_result_t *runtime_layout_calc(runtime_t *runtime) { auto workspace = state_workspace_get(state, output->current_workspace_id); if (!workspace) continue; - auto layout_slot = layout_slot_get(&runtime->layouts, workspace->layout_id); - if (!layout_slot || !layout_slot->fn) continue; - size_t window_count = 0; size_t window_list_capacity = 0; window_id_t *window_ids = nullptr; @@ -333,7 +330,8 @@ static const layout_result_t *runtime_layout_calc(runtime_t *runtime) { } } - if (window_count) { + auto layout_func = layout_get(&runtime->layouts, workspace->layout_id); + if (window_count && layout_func) { zdwm_layout_ctx_t ctx = { .workspace_id = workspace->id, .focused_window_id = workspace->focused_window_id, @@ -342,7 +340,7 @@ static const layout_result_t *runtime_layout_calc(runtime_t *runtime) { .window_ids = window_ids, .window_count = window_count, }; - layout_slot->fn(&ctx, result); + layout_func(&ctx, result); } if (window_ids) p_delete(&window_ids);