[maemo-developers] Optimal battery life considerations in apps

From: Andrew Flegg andrew at bleb.org
Date: Sat Jul 11 14:12:54 EEST 2009
On Sat, Jul 11, 2009 at 10:26, Thomas Perl<th.perl at gmail.com> wrote:
> 2009/7/10 Andrew Flegg <andrew at bleb.org>:
>> Have you got any sample code which uses window-state-event I could use
>> as a basis for comparison?
>
> See the function window_state_event at:
>
> http://repo.or.cz/w/gpodder.git?a=blob;f=src/gpodder/gui.py;h=9b0d0bef53;hb=HEAD#l3323

Yeah, that's basically what I had (although thanks for the _WITHDRAWN
hint). Unfortunately I can't get a window-state-event to fire at all.

Are you sure your method works? I just added the following line to the
top of /usr/lib/python2.5/site-packages/gpodder/gui.py:

        print "%s - %d" % (event.type, event.new_window_state)

Starting gPodder from the terminal doesn't result in any output when
backgrounding the app, or minimising the window.

> The last time I checked, this worked, except that on Maemo 4 you get
> the "withdrawn" state and on the Desktop the "iconified" state (which
> the code above accounts for).

On Diablo (latest SSU) it doesn't seem to be working at all; although
confirmation would be appreciated before I create a test case and
raise a high-priority bug.

Cheers,

Andrew

-- 
Andrew Flegg -- mailto:andrew at bleb.org  |  http://www.bleb.org/
Maemo Community Council chair
More information about the maemo-developers mailing list