dccsillag / picom

A lightweight compositor for X11
Other
164 stars 20 forks source link

Window jumps to (0,0) upon first animation #9

Closed dccsillag closed 3 years ago

dccsillag commented 3 years ago

I've finally been able to reliably reproduce this.

Follow the steps:

Instead of simply animating from where it was to where you moved it, the window will have jumped to (0,0) and then animated to where it was supposed to be.

dccsillag commented 3 years ago

It's worth noting that this does not happen in @alexfrederiksen's PR. After looking at his code, my guess is that it has something to do with the initialization of the w->animation_* members in win.c.

dccsillag commented 3 years ago

Solved.

What happened is that animation_{x,y} were both equal to 0. Now they get properly initialized via pending_g. Also, we take some care regarding animation_progress -- values in [0,1) denote that we are in the middle of an animation, while anything else means that we are not. Plus some care in managing old_win_image.