From 5e332b0426fb3ef178f5c4a64e86eccf766215f4 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 25 Feb 2025 20:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A8=E7=94=BB=E5=89=AA?= =?UTF-8?q?=E5=88=87=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maomao.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maomao.c b/maomao.c index 8667f403..a21289d8 100644 --- a/maomao.c +++ b/maomao.c @@ -123,6 +123,7 @@ enum { }; /* EWMH atoms */ #endif enum { UP, DOWN, LEFT, RIGHT, UNDIR }; /* movewin */ +enum {NONE,OPEN,MOVE,CLOSE,TAG}; typedef struct { int i; @@ -165,6 +166,7 @@ struct dwl_animation { uint32_t duration; struct wlr_box initial; struct wlr_box current; + int action; }; typedef struct Pertag Pertag; @@ -878,7 +880,7 @@ void apply_border(Client *c, struct wlr_box clip_box, int offset) { wlr_scene_rect_set_size(c->border[0], clip_box.width, c->bw); wlr_scene_rect_set_size(c->border[1], clip_box.width, c->bw); - if (c->animation.running) { + if (c->animation.running && c->animation.action != MOVE) { if (c->animation.current.x < c->mon->m.x) { wlr_scene_rect_set_size(c->border[2], 0, 0); wlr_scene_rect_set_size(c->border[3], c->bw, clip_box.height - 2 * c->bw); @@ -944,7 +946,7 @@ void client_apply_clip(Client *c) { } // make tagout tagin animations not visible in other monitors - if (c->animation.running) { + if (c->animation.running && c->animation.action != MOVE) { if (c->animation.current.x <= c->mon->m.x) { offset = c->mon->m.x - c->animation.current.x; clip_box.x = clip_box.x + offset; @@ -4119,12 +4121,16 @@ void resize(Client *c, struct wlr_box geo, int interact) { if (c->animation.tagouting) { c->animation.duration = animation_duration_tag; + c->animation.action = TAG; } else if (c->animation.tagining) { c->animation.duration = animation_duration_tag; + c->animation.action = TAG; } else if (c->is_open_animation) { c->animation.duration = animation_duration_open; + c->animation.action = OPEN; } else { c->animation.duration = animation_duration_move; + c->animation.action = MOVE; } // 动画起始位置大小设置