opt: optimize layer animation action set
This commit is contained in:
@@ -465,7 +465,7 @@ void layer_set_pending_state(LayerSurface *l) {
|
|||||||
|
|
||||||
l->pending = l->geom;
|
l->pending = l->geom;
|
||||||
|
|
||||||
if (l->animation.action == OPEN) {
|
if (l->animation.action == OPEN && !l->animation.running) {
|
||||||
|
|
||||||
if ((!l->animation_type_open &&
|
if ((!l->animation_type_open &&
|
||||||
strcmp(layer_animation_type_open, "zoom") == 0) ||
|
strcmp(layer_animation_type_open, "zoom") == 0) ||
|
||||||
@@ -510,8 +510,6 @@ void layer_set_pending_state(LayerSurface *l) {
|
|||||||
l->animation.should_animate = false;
|
l->animation.should_animate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
l->animation.duration = animation_duration_open;
|
|
||||||
l->animation.action = OPEN;
|
|
||||||
// 开始动画
|
// 开始动画
|
||||||
layer_commit(l);
|
layer_commit(l);
|
||||||
l->dirty = true;
|
l->dirty = true;
|
||||||
|
|||||||
@@ -2556,6 +2556,7 @@ void maplayersurfacenotify(struct wl_listener *listener, void *data) {
|
|||||||
|
|
||||||
// 初始化动画
|
// 初始化动画
|
||||||
if (animations && layer_animations && !l->noanim) {
|
if (animations && layer_animations && !l->noanim) {
|
||||||
|
l->animation.duration = animation_duration_open;
|
||||||
l->animation.action = OPEN;
|
l->animation.action = OPEN;
|
||||||
layer_set_pending_state(l);
|
layer_set_pending_state(l);
|
||||||
}
|
}
|
||||||
@@ -2605,6 +2606,7 @@ void commitlayersurfacenotify(struct wl_listener *listener, void *data) {
|
|||||||
l->geom.width = box.width;
|
l->geom.width = box.width;
|
||||||
l->geom.height = box.height;
|
l->geom.height = box.height;
|
||||||
l->animation.action = MOVE;
|
l->animation.action = MOVE;
|
||||||
|
l->animation.duration = animation_duration_move;
|
||||||
l->need_output_flush = true;
|
l->need_output_flush = true;
|
||||||
layer_set_pending_state(l);
|
layer_set_pending_state(l);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user