pyt0xic / hyprfocus

a focus animation plugin for Hyprland inspired by Flashfocus
BSD 3-Clause "New" or "Revised" License
50 stars 6 forks source link

Broken Animations #8

Open nnra6864 opened 4 months ago

nnra6864 commented 4 months ago

I can't provide a video because obs is currently broken. Basically, as soon as I enable this plugin, certain animations break. Easiest one to spot would be a window moving away when opening a new window next to it. I am using these settings:

plugin {
    hyprfocus {
    enabled = yes
    animate_floating = yes
    animate_workspacechange = yes
    focus_animation = shrink
    bezier = realsmooth, 0.28,0.29,.69,1.08
    shrink {
        shrink_percentage = 0.9975
        in_bezier = realsmooth
        in_speed = 1
        out_bezier = realsmooth
        out_speed = 2
    }
}
animations {
    enabled = true
    bezier = myBezier, 0.05, 0.9, 0.1, 1.05
    bezier = linear, 0.0, 0.0, 1.0, 1.0 
    bezier = quad, 0.45, 0, 0.55, 1
    bezier = quadOut, 0.5, 1, 0.89, 1
    bezier = expo, 0.87, 0, 0.13, 1
    bezier = expoIn, 0.7, 0, 0.84, 0
    bezier = expoOut, 0.16, 1, 0.3, 1

    animation = windows, 1, 3, expoOut, slide
    animation = windowsOut, 1, 3, expoOut, slide
    animation = windowsMove, 1, 3, expoOut

    animation = layersIn, 1, 3, expoOut, fade
    animation = layersOut, 1, 3, expoOut, fade

    animation = fade, 1, 3, expoOut

    animation = border, 1, 3, quadOut
    animation = borderangle, 1, 30, linear, loop

    animation = workspaces, 1, 3, expoOut
    animation = specialWorkspace, 1, 3, expoOut, slidefadevert
}

The animation of the window getting away gets slowed down a considerable amount and it just feels really bad.

pyt0xic commented 4 months ago

Let me see if I can reproduce this, I do think the animation code could optimized a bit, does the slow down still happen with the flash animation?

nnra6864 commented 4 months ago

Let me see if I can reproduce this, I do think the animation code could optimized a bit, does the slow down still happen with the flash animation?

Just tested, the slowdown doesn't happen with animation set to flash.

pyt0xic commented 4 months ago

That's interesting, my best guess is that, when opening/closing a second window on the same workspace, it looks laggy/glitchy because Hyprland has to display the shrink animation + normal window animations.

I think this will be pretty easy to fix by hooking into the window opened and window closed events so we can skip the focus animation for those windows...

daxisunder commented 3 months ago

Hey @pyt0xic, do you plan a new release since Hyprland has moved from wlroots?