opt:only scale first frame when zoomin

This commit is contained in:
DreamMaoMao 2025-03-28 14:28:24 +08:00
parent f2d307b1d1
commit 3982134e59

View file

@ -249,6 +249,7 @@ struct Client {
pid_t pid; pid_t pid;
Client *swallowing, *swallowedby; Client *swallowing, *swallowedby;
bool is_clip_to_hide; bool is_clip_to_hide;
bool need_scale_first_frame;
}; };
@ -4224,6 +4225,13 @@ void snap_scene_buffer_apply_size(struct wlr_scene_buffer *buffer, int sx,
void buffer_set_size(Client *c, animationScale data) { void buffer_set_size(Client *c, animationScale data) {
if (c->animation.current.width <= c->geom.width &&
c->animation.current.height <= c->geom.height && !c->need_scale_first_frame) {
return;
}
c->need_scale_first_frame = false;
if (c->iskilling || c->animation.tagouting || if (c->iskilling || c->animation.tagouting ||
c->animation.tagouted || c->animation.tagining) { c->animation.tagouted || c->animation.tagining) {
return; return;
@ -4487,6 +4495,7 @@ void resize(Client *c, struct wlr_box geo, int interact) {
// wl_event_source_timer_update(c->timer_tick, 10); // wl_event_source_timer_update(c->timer_tick, 10);
c->need_output_flush = true; c->need_output_flush = true;
c->need_scale_first_frame = true;
// oldgeom = c->geom; // oldgeom = c->geom;
bbox = interact ? &sgeom : &c->mon->w; bbox = interact ? &sgeom : &c->mon->w;