mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-06 07:15:53 -04:00
support fadein fadeout animation
This commit is contained in:
parent
00d42f5d4f
commit
9b809f4011
1 changed files with 21 additions and 4 deletions
25
main.c
25
main.c
|
|
@ -129,6 +129,7 @@ struct dwl_animation {
|
|||
bool tagining;
|
||||
bool tagouted;
|
||||
bool tagouting;
|
||||
bool begin_fade_in;
|
||||
uint32_t total_frames;
|
||||
uint32_t passed_frames;
|
||||
struct wlr_box initial;
|
||||
|
|
@ -685,13 +686,24 @@ client_animation_next_tick(Client *c)
|
|||
.width = width,
|
||||
.height = height,
|
||||
};
|
||||
|
||||
if(c->is_open_animation && animation_fade_in)
|
||||
|
||||
if(!c->iskilling && (c->is_open_animation||c->animation.begin_fade_in) && animation_fade_in) {
|
||||
c->animation.begin_fade_in = true;
|
||||
client_set_opacity(c,animation_passed);
|
||||
}
|
||||
|
||||
if(c->iskilling) {
|
||||
client_set_opacity(c,1 - animation_passed );
|
||||
}
|
||||
|
||||
c->is_open_animation = false;
|
||||
|
||||
if (animation_passed == 1.0)
|
||||
{
|
||||
c->is_open_animation = false;
|
||||
if(c->animation.begin_fade_in) {
|
||||
c->animation.begin_fade_in = false;
|
||||
}
|
||||
|
||||
c->animation.running = false;
|
||||
if(c->iskilling) {
|
||||
c->iskilling = false;
|
||||
|
|
@ -2616,7 +2628,7 @@ focustop(Monitor *m)
|
|||
{
|
||||
Client *c;
|
||||
wl_list_for_each(c, &fstack, flink) {
|
||||
if(c->iskilling || c->animation.tagouting || c->animation.tagouted)
|
||||
if(c->iskilling)
|
||||
continue;
|
||||
if (VISIBLEON(c, m))
|
||||
return c;
|
||||
|
|
@ -3786,6 +3798,11 @@ resize(Client *c, struct wlr_box geo, int interact)
|
|||
c->geom = geo;
|
||||
applybounds(c, bbox);//去掉这个推荐的窗口大小,因为有时推荐的窗口特别大导致平铺异常
|
||||
|
||||
if(!c->is_open_animation) {
|
||||
c->animation.begin_fade_in = false;
|
||||
client_set_opacity(c,1);
|
||||
}
|
||||
|
||||
// 动画起始位置大小设置
|
||||
if(c->animation.tagouting) {
|
||||
c->animainit_geom = c->geom;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue