Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reload backgrounds and not just images #583

Merged
merged 6 commits into from
Dec 18, 2024
Merged

Conversation

robin-carlier
Copy link
Contributor

This adds the ability to reload backgrounds (and not just images). This was asked for in #290.

The code is mostly copypasta of the code for the image widget, with suitable modifications.

Since backgrounds are usually big, I also added an option to cross-fade between the old and the new background to avoid abrupt changes. The cross-fade can be customized with a float option crossfade_time for the widget. A negative value means no cross-fade.
The "mixing texture" shader I had to add for this can probably be used to implement similar cross-fades for image widgets, but I didn’t do it.

All timers/reloading options are ignored for screenshot-type backgrounds (perhaps that can be improved, but I’m not sure on how to handle reloading if reload_cmd is not supplied and the background is a screenshot).

I’m not a C++ dev nor a graphics programmer so pardon me if I did things the wrong way.

src/renderer/widgets/Background.cpp Outdated Show resolved Hide resolved
src/renderer/widgets/Background.cpp Outdated Show resolved Hide resolved
src/renderer/widgets/Background.hpp Outdated Show resolved Hide resolved
src/renderer/widgets/Background.hpp Outdated Show resolved Hide resolved
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would've been definitely simpler once @PaideiaDilemma makes the anim manager generic lole

src/renderer/widgets/Background.hpp Outdated Show resolved Hide resolved
src/renderer/widgets/Background.cpp Outdated Show resolved Hide resolved
src/renderer/widgets/Background.cpp Outdated Show resolved Hide resolved
src/renderer/widgets/Background.cpp Outdated Show resolved Hide resolved
src/renderer/widgets/Background.cpp Outdated Show resolved Hide resolved
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! Wiki mr needed

@vaxerski vaxerski merged commit 0588306 into hyprwm:main Dec 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants