hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.63k stars 903 forks source link

Direct animation to window translation #8371

Open SpomJ opened 1 week ago

SpomJ commented 1 week ago

Description

The way window animations work currently is the following:

  1. A resize cause is noticed
  2. A single resize event is sent to the window, with the target coordinates
  3. The output of the window is being continuously shown, while being stretched to fit the borders the resize animation describes

What I propose is to make a flag to make [certain] animations behave like the following: retrieve the target window size from the animation each frame and for each frame send a resizing event to the window, making it actually follow the animation. Because some software doesn't adapt to this well it wouldn't hurt to allow sending events every N frames, interpolating the rest the old way, and/or a windowrule to toggle this for specific groups of windows.

The target behavior is something akin to what happens when you manually resize the window (by dragging)

What this hopes to accomplish is to get rid of the "flickering" caused by scaling suddenly changing when window drastically changes size.

vaxerski commented 6 days ago

I don't think this is a good idea overall... No OS / DE does this.

SpomJ commented 5 days ago

I mean OS/DEs generally don't really do animations the way Hyprland does so there's that...

I suppose it would be nice to see first and decide whether it's worth it second, but that's not how programming works. IMO it would be better for slower and/or more linear-like animations since currently the snap is already noticeable at 3s animation duration (if the curve is sane ofc) when toggling large tile into a small float.

May as well not be worth the hassle, but again, would be interesting to see.

vaxerski commented 5 days ago

we used to have a similar thing to what KDE does and it was heavily requested to be removed, thus it was.

SpomJ commented 3 days ago

we used to have a similar thing to what KDE does

What was the thing?

vaxerski commented 3 days ago

take a snapshot at the beginning of animation and render it on top of the new surface contents, fading out the old