mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-21 06:59:53 -05:00
fix: crash set window width or height less than 1
This commit is contained in:
parent
a65baf0ba5
commit
1f45f2a910
1 changed files with 2 additions and 4 deletions
6
maomao.c
6
maomao.c
|
|
@ -4848,6 +4848,8 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
|||
if (strcmp(c->mon->pertag->ltidxs[c->mon->pertag->curtag]->name,
|
||||
"scroller") == 0) {
|
||||
c->geom = geo;
|
||||
c->geom.width = MAX(1 + 2 * (int)c->bw, c->geom.width);
|
||||
c->geom.height = MAX(1 + 2 * (int)c->bw, c->geom.height);
|
||||
} else { // 这里会限制不允许窗口划出屏幕
|
||||
client_set_bounds(
|
||||
c, geo.width,
|
||||
|
|
@ -4857,10 +4859,6 @@ void resize(Client *c, struct wlr_box geo, int interact) {
|
|||
c, bbox); // 去掉这个推荐的窗口大小,因为有时推荐的窗口特别大导致平铺异常
|
||||
}
|
||||
|
||||
if((int32_t)c->geom.width <0 || (int32_t)c->geom.height <0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c->is_open_animation) {
|
||||
c->animation.begin_fade_in = false;
|
||||
client_set_opacity(c, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue