Signal-desktop: Pause GIFs when window is not in focus without having to minimize

Created on 28 Feb 2020  路  7Comments  路  Source: signalapp/Signal-Desktop

  • [x] I have searched open and closed issues for duplicates

Bug Description

Hi there. I use both Signal and Discord pretty heavily as a gamer on Windows 10, and I'd love it if we had the option to pause GIFs when the Signal window loses focus, like Discord does. It's not a huge issue, but it does feel like a bit of a UX problem that I have to hunt for the minimize button when alt-tabbing is much faster.

Steps to Reproduce

  1. Have an animated GIF that's either been sent or received visible in a Signal conversation.
  2. Switch to another app.
  3. Make the Signal app visible either by moving a window that's on top partially out of the way or press and hold alt+tab to bring up the app switcher.

Actual Result: GIF continues to play while Signal is not focused.

Expected Result: GIF is paused while Signal is not focused.

Platform Info

Signal Version: v1.31.0

Operating System: Windows 10 Home v1903 (build 18362.657)

Feature Request

Most helpful comment

I was also going to request this.

MS Teams has a similar feature that plays the gif for about 30 seconds then pauses it on the first frame. If that chat loses focus, it is paused. If you click on the gif, it pauses the it and a little pause indicator appears over it. Clicking it resumes play. It will loop for another 30 seconds if play is clicked.

I often have teams and signal open side by side, its very distracting to see a constantly moving gif on a mostly static screen.

All 7 comments

Could you talk about why this is important to you? Is it that you don't want your computer using the resources to animate the GIF while it's in the background? Or you don't want to lose your place in the GIF playback?

@scottnonnenberg-signal It's primarily for performance reasons. That said, I'm not sure how much a performance hit most GIFs are.

I was also going to request this.

MS Teams has a similar feature that plays the gif for about 30 seconds then pauses it on the first frame. If that chat loses focus, it is paused. If you click on the gif, it pauses the it and a little pause indicator appears over it. Clicking it resumes play. It will loop for another 30 seconds if play is clicked.

I often have teams and signal open side by side, its very distracting to see a constantly moving gif on a mostly static screen.

I would also like to see this in some form. I find that signal takes about 5-10% CPU when it has a GIF visible, but almost nothing when I scroll the GIF out of view or switch conversations.

I found the same behavior with Slack's GIFs and animated reacts. Slack has an option to disable animations, which I have done and seems to help my battery life and performance.

It would be good to see an option to disable animations, have GIFs click-to-play, or auto-pause them after a set amount of time (or any combination of those things).

In the end it seems like a problem with Electron being heavy when showing animated content, so any way to mitigate this issue would be welcomed.

I noticed this when I had signal open on a second monitor and agree it's distracting. @scottnonnenberg-signal this is something I'd be interested in contributing; I spent a while exploring the code today and have a rough idea of how it could be implemented.

  • In main.js subscribe to the main window focus and blur events which trigger when the main window gains/loses focus
  • Broadcast an event to which Image components can subscribe - I'm not sure what the preferred mechanism for this would be
  • In Image.tsx, use the attachment MIME type to determine if the image is a gif. If it is, render a canvas element as well as an img, with the img visible by default displaying the animated gif.
  • on loss of window focus, render the current gif frame into the canvas element and toggle visibility so the static canvas is visible.
  • on focus, toggle the visibility back to the animated img element.

To me, this is an accessibility issue. I have a brain injury which means that multitasking, conscious or subconscious, is detrimental to me. This means that any time a gif is sent in the Signal client, I have to hide it from view when I'm doing other tasks on the computer, else my head will subconsciously pick up on it and wear itself out after a minute.

Obviously the workaround is fairly simple (change conversation or hide the window) so this is low priority, but having the feature would be very nice.

Could you talk about why this is important to you? Is it that you don't want your computer using the resources to animate the GIF while it's in the background? Or you don't want to lose your place in the GIF playback?

It is extremely distracting since all my messengers are running on a second monitor being visible all the time. it signals my brain that there is new content i need to attend all the time. This is one of the most basic features a messenger needs to have.

Was this page helpful?
0 / 5 - 0 ratings