[maemo-developers] Optimal battery life considerations in apps
From: Henrik Hedberg henrik.hedberg at innologies.fiDate: Thu Jul 9 12:02:43 EEST 2009
- Previous message: Optimal battery life considerations in apps
- Next message: Re: Optimal battery life considerations in apps
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Andrew Flegg wrote 09.07.2009 00:29: > 2) Stop updating the screen when your app isn't in the > foreground. > > (1) is trivial to implement. (2) is trickier (there's > hildon_program_is_topmost() and hildon_window_is_topmost(), but > polling to discover when you're topmost again is hideous). You are raising a very important question. Actually, hildon_program_is_topmost() and hildon_window_is_topmost() are not enough, because a desktop widget (HDHomePluginItem) is not a Hildon Window, but inherited from GtkWindow. Thus, there is also need for hildon_gtk_window_is_topmost(GtkWindow*); > 2) In Fremantle, there's a compositing window manager. On a > desktop this means you never receive an "expose" event > since your window is always exposed on an off-screen > buffer. What is the best way of implementing (2) in > Maemo 5? There is a standard X event for that: XVisibilityEvent. The X server (and a window manager) can keep window contents cached (backing store) and decide not to send exposure events, but my interpretation is that if it is not sending visibility events it is broken (and it is currently as I showed in my earlier post). There is no need to reinvent the wheel. We could just hope that Nokia fixes the issue - in a standard way. The main advantage of using Linux also in mobile devices is that developers can use their earlier knowledge and code from desktop world (UI is a different thing, naturally). Maemo is going to dangerous direction if more and more things are done differently. I really do not hope that. BR, Henrik -- Henrik Hedberg - http://www.henrikhedberg.net/
- Previous message: Optimal battery life considerations in apps
- Next message: Re: Optimal battery life considerations in apps
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]