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

Gif Support #773

Open
mcgdb opened this issue Nov 2, 2020 · 4 comments
Open

Gif Support #773

mcgdb opened this issue Nov 2, 2020 · 4 comments
Labels

Comments

@mcgdb
Copy link

mcgdb commented Nov 2, 2020

I'd like to help....Is it possible to allow animated gifs for icons?

@mcgdb mcgdb changed the title j Gif Support Nov 2, 2020
@tsipinakis
Copy link
Member

tsipinakis commented Nov 3, 2020

Using animated gifs is not currently possible, dunst will simply show the first frame.

Implementation wise there is some support in GDK pixbuf for animations, however the difficulty would be to get the update frequency right.

Currently redrawing is an expensive procedure as we redraw from scratch all notifications so we avoid doing it as much as possible. Implementing that would require some refactoring to store intermediate results and make the redraw process faster.

@mcgdb
Copy link
Author

mcgdb commented Nov 5, 2020

i've never been afraid of punching above my weight class....can you give me a hint of where to start looking (in the dunst project, i mean...that link to the gtk-pixbuf is a great clue!)

@tsipinakis
Copy link
Member

Most of the work needs to be done in draw.c.

The goal is to be able to call draw to redraw the window with minimal cost to keep up with the gif framerate.

To implement gif support a rough plan would be:

  • Add gif loading/frame advancing support in icon.c/draw.c
  • On each redraw advance the frame
  • Force a redraw each X ms to keep a standard framerate.

But as I mentioned above for this to be merge-able I'd also like to see some optimizations in the drawing procedure. Some things on the top of my head: Cache the icon rather than reloading it each time and cache the colored layout and any intermediaries and figure out a way to properly invalidate it when a notification is updated. There are probably more than can be done but these are the bare minimum IMO.

@bynect
Copy link
Member

bynect commented Feb 21, 2024

I would say that having different windows (#1018) would be really useful to this kind of thing (animations) since you can redraw single notifications and not the whole thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants