mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-13 04:28:13 -05:00
fix: smartgap apply error
This commit is contained in:
parent
49921eadfa
commit
39ee815139
1 changed files with 16 additions and 15 deletions
|
|
@ -354,7 +354,6 @@ void apply_border(Client *c) {
|
|||
if (!c || c->iskilling || !client_surface(c)->mapped)
|
||||
return;
|
||||
|
||||
bool hit_no_border = check_hit_no_border(c);
|
||||
enum corner_location current_corner_location;
|
||||
if (c->isfullscreen || (no_radius_when_single && c->mon &&
|
||||
c->mon->visible_tiling_clients == 1)) {
|
||||
|
|
@ -363,20 +362,6 @@ void apply_border(Client *c) {
|
|||
current_corner_location = set_client_corner_location(c);
|
||||
}
|
||||
|
||||
// Handle no-border cases
|
||||
if (hit_no_border && smartgaps) {
|
||||
c->bw = 0;
|
||||
c->fake_no_border = true;
|
||||
} else if (hit_no_border && !smartgaps) {
|
||||
wlr_scene_rect_set_size(c->border, 0, 0);
|
||||
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
||||
c->fake_no_border = true;
|
||||
return;
|
||||
} else if (!c->isfullscreen && VISIBLEON(c, c->mon)) {
|
||||
c->bw = c->isnoborder ? 0 : borderpx;
|
||||
c->fake_no_border = false;
|
||||
}
|
||||
|
||||
struct wlr_box clip_box = c->animation.current;
|
||||
// 一但在GEZERO如果使用无符号,那么其他数据也会转换为无符号导致没有负数出错
|
||||
int32_t bw = (int32_t)c->bw;
|
||||
|
|
@ -981,6 +966,22 @@ void resize(Client *c, struct wlr_box geo, int32_t interact) {
|
|||
c->bw = 0;
|
||||
}
|
||||
|
||||
bool hit_no_border = check_hit_no_border(c);
|
||||
|
||||
// Handle no-border cases
|
||||
if (hit_no_border && smartgaps) {
|
||||
c->bw = 0;
|
||||
c->fake_no_border = true;
|
||||
} else if (hit_no_border && !smartgaps) {
|
||||
wlr_scene_rect_set_size(c->border, 0, 0);
|
||||
wlr_scene_node_set_position(&c->scene_surface->node, c->bw, c->bw);
|
||||
c->fake_no_border = true;
|
||||
return;
|
||||
} else if (!c->isfullscreen && VISIBLEON(c, c->mon)) {
|
||||
c->bw = c->isnoborder ? 0 : borderpx;
|
||||
c->fake_no_border = false;
|
||||
}
|
||||
|
||||
// c->geom 是真实的窗口大小和位置,跟过度的动画无关,用于计算布局
|
||||
c->configure_serial = client_set_size(c, c->geom.width - 2 * c->bw,
|
||||
c->geom.height - 2 * c->bw);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue