ags icon indicating copy to clipboard operation
ags copied to clipboard

Workspace animation jiggly

Open musjj opened this issue 1 year ago • 8 comments

Mine:

https://github.com/Aylur/ags/assets/72612857/9e7d86bf-21cf-4235-9d1a-5366c7a0e13c

Yours:

https://github.com/Aylur/ags/assets/72612857/7a909402-7c16-4df9-a8c7-552dd81eb824

This is something that's been driving me nuts, but my workspace animation is "jiggly" for some reason. When it animates, it kinda shifts the spacing in a weird way.

I copied the workspace part of your dotfiles pretty closely, so I'm not sure what went wrong here.

musjj avatar Feb 27 '24 20:02 musjj

mine used to be like that too, but I just got used to it and didn't even notice that it went away It used to be buttons inside an eventbox, but now its just a button with labels inside, maybe that caused it?

Aylur avatar Feb 27 '24 21:02 Aylur

I wonder how Gnome implements this in their shell. From my casual observation, they don't have this problem.

I'm actually noticing that your implementation also "jiggles" when transitioning between the "empty" workspaces. Maybe Gnome is manually animating it with js?

musjj avatar Mar 10 '24 09:03 musjj

it jiggles because an empty widget takes up less space than an occupied one gnome-shell is tightly integrated with with its compositor, which lets them follow workspaces with its animation

Aylur avatar Mar 10 '24 13:03 Aylur

Hmmm, I kinda doubt that compositors can manipulate a UI element like this (or if it's even worth doing).

I looked through the gnome-shell's repo and just as I suspected, they're manually animating everything in js without a single css transition in sight. A few relevant places in the codebase:

  • https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/7e5d97c52a80389c694b09d6c25325e4d13f6c00/js/ui/panel.js#L336-387

  • https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/7e5d97c52a80389c694b09d6c25325e4d13f6c00/js/ui/panel.js#L261-333

Might look into this further and see if I can replicate in ags.

musjj avatar Mar 13 '24 14:03 musjj

yes, but they are querying the workspace positions through Meta which are the bindings to the compositor, thats how the animation can follow swipe gestures

Aylur avatar Mar 13 '24 16:03 Aylur

Oh, not sure about swipe gestures. Haven't used Gnome that much, but I'm mostly just annoyed with the jiggliness/unstableness. So I don't think I'd be needing swipe gestures.

musjj avatar Mar 13 '24 16:03 musjj

it jiggles because an empty widget takes up less space than an occupied one gnome-shell is tightly integrated with with its compositor, which lets them follow workspaces with its animation

I think you're not quite getting the point, it's not about the element pushing each other away, it's all about the smoothness of the animation, for some reason the last frames seem to skip.

P.s. I am also looking for a solution for this problem, if anyone knows how to fix this, let me know and want to add that I'm absolutely not sure of what I'm saying, I'm new with it

https://github.com/user-attachments/assets/7859de9a-c74d-41ae-b395-57d30a4194d0

TheMelbine avatar Jul 26 '24 10:07 TheMelbine

More specifically, the dot kind of grows a bit faster than it shrinks. So it causes the overall length of the widget to grow an extra pixel or two as the dots transitions. I once tried to set the css transition timing to linear, but it just made it worse for some reason.

To visualize the transition in ASCII (think of the |-| as a workspace dot):

|------|-|-|

|-----|----|-|

|----|-----|-|

|---|------|-|

|--|------|-|

|-|------|-|

Makes me wonder whether the issue still persists in GTK4.

musjj avatar Jul 27 '24 09:07 musjj