Detecting when PopupApplet is iconified

Sebastian Kügler sebas at kde.org
Fri Mar 19 17:43:34 CET 2010


On Friday 19 March 2010 17:21:37 Aaron J. Seigo wrote:
> On March 18, 2010, Rob Hasselbaum wrote:
> > On Thu, Mar 18, 2010 at 11:04 AM, Marco Martin <notmart at gmail.com> wrote:
> > > what are you exactly trying to accomplish?
> 
> thanks for asking the Right Question(tm) :)
> 
> > > usually you shouldn't care of a detail like that
> > 
> > I have a data engine that pushes data to my applet asynchronously. When
> > the applet isn't being shown, I want to disconnect from the source to
> > reduce CPU overhead.
> 
> i can think of various hacks to accomplish this, but they aren't
> particularly pretty and i only know they'll work because i know how things
> work internally (which is never a good sign for a "solution" ;)
> 
> i think the only clean solution to this would be to offer a bool
> PopupApplet::isIconified() const method.
> 
> btw, i sat here for a few minutes trying to discount your use case, but it
> is a valid one imho. if it is't being shown to the user, the applet should
> at least have a chance of not waking up the cpu.
> 
> my only question now is how to handle notification of the change. my first
> thought would be to add a new Contraint (IconifiedConstraint?) and then the
> applet could respond in constraintsEvent.

It's not only about being iconified, the applet could also be one a containment 
that's not shown, or on the dashboard (separate from the desktop background and 
invisible).

I wonder if we could just offer queueing updates from dataengines until an applet is 
about to be shown. Especially for mobile devices, this "not waking up unless shown" 
can be very important.
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Plasma-devel mailing list