format code

This commit is contained in:
DreamMaoMao 2025-06-14 21:45:06 +08:00
parent 247463a1dd
commit 20d132de3f
2 changed files with 87 additions and 90 deletions

View file

@ -1132,9 +1132,11 @@ void apply_border(Client *c) {
// These values will be positive when window is outside the monitor // These values will be positive when window is outside the monitor
int outside_left = GEZERO(c->mon->m.x - c->animation.current.x); int outside_left = GEZERO(c->mon->m.x - c->animation.current.x);
int outside_top = GEZERO(c->mon->m.y - c->animation.current.y); int outside_top = GEZERO(c->mon->m.y - c->animation.current.y);
int outside_right = GEZERO((c->animation.current.x + c->animation.current.width) - int outside_right =
GEZERO((c->animation.current.x + c->animation.current.width) -
(c->mon->m.x + c->mon->m.width)); (c->mon->m.x + c->mon->m.width));
int outside_bottom = GEZERO((c->animation.current.y + c->animation.current.height) - int outside_bottom =
GEZERO((c->animation.current.y + c->animation.current.height) -
(c->mon->m.y + c->mon->m.height)); (c->mon->m.y + c->mon->m.height));
// Initialize border dimensions // Initialize border dimensions
@ -1158,7 +1160,8 @@ void apply_border(Client *c) {
int right_y = bw; int right_y = bw;
// Adjust borders when window is outside monitor // Adjust borders when window is outside monitor
if (ISTILED(c) || c->animation.tagining || c->animation.tagouted || c->animation.tagouting) { if (ISTILED(c) || c->animation.tagining || c->animation.tagouted ||
c->animation.tagouting) {
// Top border - reduce height when window goes above monitor // Top border - reduce height when window goes above monitor
if (outside_top > 0) { if (outside_top > 0) {
top_height = GEZERO(bw - outside_top); top_height = GEZERO(bw - outside_top);
@ -1192,13 +1195,10 @@ void apply_border(Client *c) {
top_width = top_width - outside_right; top_width = top_width - outside_right;
bottom_width = bottom_width - outside_right; bottom_width = bottom_width - outside_right;
} }
} }
// Position the surface within the borders // Position the surface within the borders
wlr_scene_node_set_position(&c->scene_surface->node, wlr_scene_node_set_position(&c->scene_surface->node, bw, bw);
bw,
bw);
// Set border sizes // Set border sizes
set_rect_size(c->border[0], top_width, top_height); // Top set_rect_size(c->border[0], top_width, top_height); // Top
@ -1211,8 +1211,6 @@ void apply_border(Client *c) {
wlr_scene_node_set_position(&c->border[1]->node, bottom_x, bottom_y); wlr_scene_node_set_position(&c->border[1]->node, bottom_x, bottom_y);
wlr_scene_node_set_position(&c->border[2]->node, left_x, left_y); wlr_scene_node_set_position(&c->border[2]->node, left_x, left_y);
wlr_scene_node_set_position(&c->border[3]->node, right_x, right_y); wlr_scene_node_set_position(&c->border[3]->node, right_x, right_y);
} }
struct uvec2 clip_to_hide(Client *c, struct wlr_box *clip_box) { struct uvec2 clip_to_hide(Client *c, struct wlr_box *clip_box) {
@ -1236,9 +1234,8 @@ struct uvec2 clip_to_hide(Client *c, struct wlr_box *clip_box) {
clip_box->width = clip_box->width - offsetx; clip_box->width = clip_box->width - offsetx;
} else if (c->animation.current.x + c->animation.current.width > } else if (c->animation.current.x + c->animation.current.width >
c->mon->m.x + c->mon->m.width) { c->mon->m.x + c->mon->m.width) {
clip_box->width = clip_box->width = clip_box->width - (c->animation.current.x +
clip_box->width - c->animation.current.width -
(c->animation.current.x + c->animation.current.width -
c->mon->m.x - c->mon->m.width); c->mon->m.x - c->mon->m.width);
} }