opt: Optimize some function names

This commit is contained in:
DreamMaoMao 2026-07-01 11:58:03 +08:00
parent d3cf4319cd
commit 186259cf44
3 changed files with 16 additions and 16 deletions

View file

@ -412,7 +412,7 @@ void client_draw_shadow(Client *c) {
wlr_scene_shadow_set_clipped_region(c->shadow, clipped_region); wlr_scene_shadow_set_clipped_region(c->shadow, clipped_region);
} }
void client_draw_title(Client *c) { void client_draw_groupbar(Client *c) {
if (!c || !c->group_bar) if (!c || !c->group_bar)
return; return;
@ -500,7 +500,7 @@ void client_draw_title(Client *c) {
} }
} }
void apply_shield(Client *c, struct wlr_box clip_box) { void client_draw_shield(Client *c, struct wlr_box clip_box) {
if (clip_box.width <= 0 || clip_box.height <= 0) { if (clip_box.width <= 0 || clip_box.height <= 0) {
wlr_scene_node_set_enabled(&c->shield->node, false); wlr_scene_node_set_enabled(&c->shield->node, false);
@ -571,7 +571,7 @@ void global_draw_group_bar(Client *c, int32_t x, int32_t y, int32_t width,
mango_group_bar_set_size(c->group_bar, width, height); mango_group_bar_set_size(c->group_bar, width, height);
} }
void apply_split_border(Client *c, bool hit_no_border) { void client_draw_split_border(Client *c, bool hit_no_border) {
if (c->iskilling || !c->mon || !client_surface(c)->mapped) if (c->iskilling || !c->mon || !client_surface(c)->mapped)
return; return;
@ -662,7 +662,7 @@ void apply_split_border(Client *c, bool hit_no_border) {
border_right_y); border_right_y);
} }
void apply_border(Client *c) { void client_draw_border(Client *c) {
if (!c || c->iskilling || !client_surface(c)->mapped) if (!c || c->iskilling || !client_surface(c)->mapped)
return; return;
@ -681,7 +681,7 @@ void apply_border(Client *c) {
} }
bool hit_no_border = check_hit_no_border(c); bool hit_no_border = check_hit_no_border(c);
apply_split_border(c, hit_no_border); client_draw_split_border(c, hit_no_border);
struct fx_corner_radii current_corner_location = struct fx_corner_radii current_corner_location =
c->isfullscreen || (config.no_radius_when_single && c->mon && c->isfullscreen || (config.no_radius_when_single && c->mon &&
@ -1051,11 +1051,11 @@ void client_apply_clip(Client *c, float factor) {
offset = clip_to_hide(c, &clip_box); offset = clip_to_hide(c, &clip_box);
apply_border(c); client_draw_border(c);
client_draw_shadow(c); client_draw_shadow(c);
client_draw_title(c); client_draw_groupbar(c);
client_draw_blur(c, clip_box, offset); client_draw_blur(c, clip_box, offset);
apply_shield(c, clip_box); client_draw_shield(c, clip_box);
if (clip_box.width <= 0 || clip_box.height <= 0) { if (clip_box.width <= 0 || clip_box.height <= 0) {
should_render_client_surface = false; should_render_client_surface = false;
@ -1103,10 +1103,10 @@ void client_apply_clip(Client *c, float factor) {
offset = clip_to_hide(c, &clip_box); offset = clip_to_hide(c, &clip_box);
// 应用窗口装饰 // 应用窗口装饰
apply_border(c); client_draw_border(c);
client_draw_shadow(c); client_draw_shadow(c);
client_draw_title(c); client_draw_groupbar(c);
apply_shield(c, clip_box); client_draw_shield(c, clip_box);
client_draw_blur(c, clip_box, offset); client_draw_blur(c, clip_box, offset);
// 如果窗口剪切区域已经剪切到0则不渲染窗口表面 // 如果窗口剪切区域已经剪切到0则不渲染窗口表面
@ -1553,11 +1553,11 @@ void resize(Client *c, struct wlr_box geo, int32_t interact) {
c->geom; c->geom;
wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y); wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
apply_border(c); client_draw_border(c);
client_get_clip(c, &clip); client_get_clip(c, &clip);
apply_shield(c, clip); client_draw_shield(c, clip);
client_draw_shadow(c); client_draw_shadow(c);
client_draw_title(c); client_draw_groupbar(c);
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip); wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
if (config.blur && !c->noblur) if (config.blur && !c->noblur)
wlr_scene_blur_set_size(c->blur, wlr_scene_blur_set_size(c->blur,

View file

@ -2148,7 +2148,7 @@ int32_t dwindle_set_split_direction(Client *c, bool istoggle, bool horizontal) {
leaf->custom_leaf_split_h = false; leaf->custom_leaf_split_h = false;
} }
bool hit_no_border = check_hit_no_border(c); bool hit_no_border = check_hit_no_border(c);
apply_split_border(c, hit_no_border); client_draw_split_border(c, hit_no_border);
return 0; return 0;
} }

View file

@ -848,7 +848,7 @@ get_nearest_output_mode(struct wlr_output *output, int32_t width,
static void client_commit(Client *c); static void client_commit(Client *c);
static void layer_commit(LayerSurface *l); static void layer_commit(LayerSurface *l);
static void apply_border(Client *c); static void client_draw_border(Client *c);
static void client_set_opacity(Client *c, double opacity); static void client_set_opacity(Client *c, double opacity);
static void init_baked_points(void); static void init_baked_points(void);
static void scene_buffer_apply_opacity(struct wlr_scene_buffer *buffer, static void scene_buffer_apply_opacity(struct wlr_scene_buffer *buffer,