Translate final Chinese comments in mango.c and parse_config.h

Co-authored-by: squassina <8495707+squassina@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-18 09:03:32 +00:00
parent ffa83cd0fc
commit 3f0c11b068
2 changed files with 18 additions and 14 deletions

View file

@ -1485,8 +1485,9 @@ bool parse_option(Config *config, char *key, char *value) {
"scroller_proportion_preset format: %s\n", "scroller_proportion_preset format: %s\n",
value); value);
free(value_copy); free(value_copy);
free(config->scroller_proportion_preset); // 释放已分配的内存 free(config->scroller_proportion_preset); // Free allocated memory
config->scroller_proportion_preset = NULL; // 防止野指针 config->scroller_proportion_preset =
NULL; // Prevent dangling pointer
config->scroller_proportion_preset_count = 0; config->scroller_proportion_preset_count = 0;
return false; return false;
} }
@ -3265,16 +3266,18 @@ void set_value_default() {
/* appearance */ /* appearance */
config.axis_bind_apply_timeout = config.axis_bind_apply_timeout =
axis_bind_apply_timeout; // 滚轮绑定动作的触发的时间间隔 axis_bind_apply_timeout; // Timeout interval for mouse wheel binding
config.focus_on_activate = // actions
focus_on_activate; // 收到窗口激活请求是否自动跳转聚焦 config.focus_on_activate = focus_on_activate; // Auto-focus when receiving
config.new_is_master = new_is_master; // 新窗口是否插在头部 // window activation request
config.default_mfact = default_mfact; // master 窗口比例 config.new_is_master = new_is_master; // Insert new windows at the head
config.default_nmaster = default_nmaster; // 默认master数量 config.default_mfact = default_mfact; // Master window proportion
config.default_nmaster =
default_nmaster; // Default number of master windows
config.center_master_overspread = config.center_master_overspread =
center_master_overspread; // 中心master时是否铺满 center_master_overspread; // Whether to fill screen when center master
config.center_when_single_stack = config.center_when_single_stack =
center_when_single_stack; // 单个stack时是否居中 center_when_single_stack; // Whether to center when single stack window
config.numlockon = numlockon; // Enable numlock config.numlockon = numlockon; // Enable numlock

View file

@ -274,8 +274,8 @@ typedef struct {
struct wl_list link; struct wl_list link;
struct wlr_input_device *wlr_device; struct wlr_input_device *wlr_device;
struct libinput_device *libinput_device; struct libinput_device *libinput_device;
struct wl_listener destroy_listener; // 用于监听设备销毁事件 struct wl_listener destroy_listener; // Listen for device destruction events
void *device_data; // 新增:指向设备特定数据(如 Switch void *device_data; // Added: pointer to device-specific data (e.g. Switch)
} InputDevice; } InputDevice;
typedef struct { typedef struct {
@ -586,8 +586,9 @@ static void pinch_end(struct wl_listener *listener, void *data);
static void hold_begin(struct wl_listener *listener, void *data); static void hold_begin(struct wl_listener *listener, void *data);
static void hold_end(struct wl_listener *listener, void *data); static void hold_end(struct wl_listener *listener, void *data);
static void checkidleinhibitor(struct wlr_surface *exclude); static void checkidleinhibitor(struct wlr_surface *exclude);
static void cleanup(void); // 退出清理 static void cleanup(void); // Cleanup on exit
static void cleanupmon(struct wl_listener *listener, void *data); // 退出清理 static void cleanupmon(struct wl_listener *listener,
void *data); // Monitor cleanup
static void closemon(Monitor *m); static void closemon(Monitor *m);
static void cleanuplisteners(void); static void cleanuplisteners(void);
static void toggle_hotarea(int32_t x_root, int32_t y_root); // 触发热区 static void toggle_hotarea(int32_t x_root, int32_t y_root); // 触发热区