Translate all Chinese comments to English in source files

- Translate comments in src/client/client.h
- Translate comments in src/config/parse_config.h
- Translate comments in src/data/static_keymap.h
- Translate comments in src/dispatch/bind_define.h
- Translate comments in src/ext-protocol/*.h
- Translate comments in src/fetch/*.h
- Translate comments in src/layout/*.h
- Translate comments in src/mango.c

All Chinese comments have been accurately translated to English
while preserving the technical meaning and context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-18 09:50:35 +00:00
parent 288710ad9e
commit 2c181fcb21
16 changed files with 396 additions and 396 deletions

View file

@ -798,7 +798,7 @@ int32_t spawn_shell(const Arg *arg) {
return 0;
if (fork() == 0) {
// 1. 忽略可能导致 coredump 的信号
// 1. Ignore signals that may cause coredump
signal(SIGSEGV, SIG_IGN);
signal(SIGABRT, SIG_IGN);
signal(SIGILL, SIG_IGN);
@ -826,7 +826,7 @@ int32_t spawn(const Arg *arg) {
return 0;
if (fork() == 0) {
// 1. 忽略可能导致 coredump 的信号
// 1. Ignore signals that may cause coredump
signal(SIGSEGV, SIG_IGN);
signal(SIGABRT, SIG_IGN);
signal(SIGILL, SIG_IGN);
@ -834,7 +834,7 @@ int32_t spawn(const Arg *arg) {
dup2(STDERR_FILENO, STDOUT_FILENO);
setsid();
// 2. 解析参数
// 2. Parse parameters
char *argv[64];
char *allocated_strings[64]; // Track strdup'd strings for cleanup
int32_t argc = 0;
@ -859,10 +859,10 @@ int32_t spawn(const Arg *arg) {
}
argv[argc] = NULL;
// 3. 执行命令
// 3. Execute command
execvp(argv[0], argv);
// 4. execvp 失败时:清理并退出
// 4. When execvp fails: cleanup and exit
// If execvp succeeds, this code never runs (process replaced)
// If it fails, clean up allocated strings before exiting
for (int32_t i = 0; i < alloc_count; i++) {
@ -870,7 +870,7 @@ int32_t spawn(const Arg *arg) {
}
wlr_log(WLR_ERROR, "mango: execvp '%s' failed: %s\n", argv[0],
strerror(errno));
_exit(EXIT_FAILURE); // 使用 _exit 避免缓冲区刷新等操作
_exit(EXIT_FAILURE); // Use _exit to avoid buffer flush operations
}
return 0;
}
@ -907,7 +907,7 @@ int32_t switch_keyboard_layout(const Arg *arg) {
return 0;
}
// 1. 获取当前布局和计算下一个布局
// 1. Get current layout and calculate next layout
xkb_layout_index_t current = xkb_state_serialize_layout(
keyboard->xkb_state, XKB_STATE_LAYOUT_EFFECTIVE);
const int32_t num_layouts = xkb_keymap_num_layouts(keyboard->keymap);
@ -917,14 +917,14 @@ int32_t switch_keyboard_layout(const Arg *arg) {
}
xkb_layout_index_t next = (current + 1) % num_layouts;
// 6. 应用新 keymap
// 6. Apply new keymap
uint32_t depressed = keyboard->modifiers.depressed;
uint32_t latched = keyboard->modifiers.latched;
uint32_t locked = keyboard->modifiers.locked;
wlr_keyboard_notify_modifiers(keyboard, depressed, latched, locked, next);
// 7. 更新 seat
// 7. Update seat
wlr_seat_set_keyboard(seat, keyboard);
wlr_seat_keyboard_notify_modifiers(seat, &keyboard->modifiers);
@ -937,7 +937,7 @@ int32_t switch_keyboard_layout(const Arg *arg) {
struct wlr_keyboard *tkb = (struct wlr_keyboard *)id->device_data;
wlr_keyboard_notify_modifiers(tkb, depressed, latched, locked, next);
// 7. 更新 seat
// 7. Update seat
wlr_seat_set_keyboard(seat, tkb);
wlr_seat_keyboard_notify_modifiers(seat, &tkb->modifiers);
}
@ -1102,8 +1102,8 @@ int32_t tagmon(const Arg *arg) {
selmon = c->mon;
c->float_geom = setclient_coordinate_center(c, c->mon, c->float_geom, 0, 0);
// 重新计算居中的坐标
// 重新计算居中的坐标
// Recalculate centered coordinates
// Recalculate centered coordinates
if (c->isfloating) {
c->geom = c->float_geom;
target = get_tags_first_tag(c->tags);
@ -1586,8 +1586,8 @@ int32_t toggleoverview(const Arg *arg) {
return 0;
}
// 正常视图到overview,退出所有窗口的浮动和全屏状态参与平铺,
// overview到正常视图,还原之前退出的浮动和全屏窗口状态
// Normal view to overview, exit all floating and fullscreen states to participate in tiling,
// Overview to normal view, restore previously exited floating and fullscreen window states
if (selmon->isoverview) {
wl_list_for_each(c, &clients, link) {
if (c && c->mon == selmon && !client_is_unmanaged(c) &&