On Sun, 6 Sep 2020 08:21:45 +0200 Tobias Bengfort <tobias.bengf...@posteo.de> wrote:
> Hi, > > I am currently creating a curses application that is updated > independently of user input. Think of something like `top`. I realized > that the process is using the same amount of CPU whether it is currently > visible or not. That bothers me. I would prefer if my app got notified > when its visibility changes so it can stop rendering (I think this is > called culling). > > For this to work it would need to be supported in several places: > > - Window managers could set _NET_WM_STATE_HIDDEN > - Terminal emulators and multiplexers could set the terminal size to 0,0 > - Applications need to actually use that information > > The only project I could find that seems to do something like this is > mutter. > > So I am wondering: Is this even worth the effort? Have I missed any > prior art? > > thanks > tobias > Hi! htop, with a refresh rate of 1, uses of 1% of one the (3.40GHz) CPUs, I don't think this is a problem as people don't generally max out the CPUs. And I wouldn't think people have it running without being able to see it either. You would just be adding unneeded work and complexity for next to no gain. I would only think about this for intensive programs. Regards, Mattias Andrée