Avoid CPU usage, stop invisible spinners inside stacks
When a GtkSpinner is inside a GtkStack it may be counted as "visible" even though it cannot be seen.
In practice, that means that the spinner will be animated, causing a lot of wakeups. Unfortunately, gtk+-3 will not be fixed to handle this case (it is rather complicated to do correctly). This means, that Fractal should either:
- Stop all these spinners
- Explicitly set the stack page invisible (gtk_widget_hide)
An easy way to see this to run strace -p $( pgrep fractal )
. You'll se a lot of poll timeouts without anything else happening. These should not exist and they will disappear if all spinners are stopped (I tried this, e.g. the account settings page and other ones).
In case anyone is curious:
- gtk!2094 is an MR that theoretically fixes it on the GTK side, but is unacceptable because it would break other animations (GTK does not know whether an animation causes layout changes).
- The problem is that the CPU needs to wake up from a low power state. The power consumption impact may be much higher than just the CPU use itself as it takes time to go back to a low power state.
Edited by Benjamin Berg