mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
opt: Avoid unnecessary resize
This commit is contained in:
parent
c03dc8ebd9
commit
54de782f90
1 changed files with 8 additions and 6 deletions
14
maomao.c
14
maomao.c
|
|
@ -2502,7 +2502,6 @@ double output_frame_duration_ms(Client *c) {
|
|||
}
|
||||
|
||||
void client_commit(Client *c) {
|
||||
c->dirty = false;
|
||||
c->current = c->pending; // 设置动画的结束位置
|
||||
|
||||
if (c->animation.should_animate) {
|
||||
|
|
@ -2532,13 +2531,16 @@ void commitnotify(struct wl_listener *listener, void *data) {
|
|||
if(!c->dirty)
|
||||
return;
|
||||
|
||||
wlr_log(WLR_DEBUG, "app commit event handle:%s",client_get_appid(c));
|
||||
struct wlr_box geometry;
|
||||
client_get_geometry(c, &geometry);
|
||||
if(geometry.width == c->animation.current.width - 2 * c->bw && geometry.height == c->animation.current.height - 2 * c->bw) {
|
||||
c->dirty = false;
|
||||
return;
|
||||
}
|
||||
|
||||
wlr_log(WLR_DEBUG, "app commit event handle:%s,%d,%d",client_get_appid(c),geometry.width - c->animation.current.width,geometry.height - c->animation.current.height);
|
||||
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
|
||||
|
||||
uint32_t width, height;
|
||||
client_actual_size(c, &width, &height);
|
||||
if(width == c->geom.width && height == c->geom.height)
|
||||
c->dirty = false;
|
||||
// if (c->configure_serial && c->configure_serial <=
|
||||
// c->surface.xdg->current.configure_serial) c->configure_serial = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue