feat(action): 绑定 toggle_fullscreen/maximize/floating 快捷键

This commit is contained in:
2026-05-07 03:54:30 +08:00
parent 56f8380028
commit 8fcf46979a
4 changed files with 52 additions and 8 deletions

View File

@@ -173,7 +173,7 @@ void cycle_layout(runtime_t *runtime, int32_t delta) {
runtime->plan.need_relayout = true;
}
void cycle_current_output(zdwm_runtime_t *runtime, int32_t delta) {
void cycle_current_output(runtime_t *runtime, int32_t delta) {
auto state = &runtime->state;
state_cycle_current_output(state, delta);
}

View File

@@ -1,11 +1,23 @@
#pragma once
#include "core/runtime.h"
#include <stdint.h>
#include <zdwm/action.h>
void spawn(const char *command);
void quit(runtime_t *runtime, bool restart);
void quit(zdwm_runtime_t *runtime, bool restart);
void raise_or_run(
zdwm_runtime_t *runtime,
const char *class_name,
const char *command
);
void toggle_fullscreen(zdwm_runtime_t *runtime);
void toggle_maximize(zdwm_runtime_t *runtime);
void toggle_floating(zdwm_runtime_t *runtime);
void toggle_sticky(zdwm_runtime_t *runtime);
void switch_workspace(
zdwm_runtime_t *runtime,
zdwm_workspace_id_t workspace_id
);
void cycle_layout(zdwm_runtime_t *runtime, int32_t delta);
void cycle_current_output(zdwm_runtime_t *runtime, int32_t delta);

View File

@@ -272,9 +272,16 @@ void runtime_run(runtime_t *runtime) {
.layouts = &runtime->layouts,
.runtime = runtime,
.action_api = {
.spawn = spawn,
.quit = quit,
.raise_or_run = raise_or_run,
.spawn = spawn,
.quit = quit,
.raise_or_run = raise_or_run,
.toggle_fullscreen = toggle_fullscreen,
.toggle_maximize = toggle_maximize,
.toggle_floating = toggle_floating,
.toggle_sticky = toggle_sticky,
.switch_workspace = switch_workspace,
.cycle_layout = cycle_layout,
.cycle_current_output = cycle_current_output,
},
};