[Sugar-devel] pygame activities stop XO sleep?

Gary Martin garycmartin at googlemail.com
Fri Dec 31 07:46:44 EST 2010


Hi Peter,

On 30 Dec 2010, at 21:40, Peter Hewitt <prh at mulawa.net> wrote:

> Hope this is the right place for this my first post.

Yes, right place :)

> It seems that my pygame activities prevent the XO (both models) from going to sleep. This problem persists even after my activity has stopped.
> 
> Someone suggested that this happens with other pygame activities.
> 
> Does anyone have a solution for this problem?

In addition to advice from James, you might also want to consider the case when your activity is not in the user focus, as they switch away to a different activity or use one of the home views. A few months back I added some extra event checks to Physics so that it minimises its run loop work when not in focus (updates come from a continious physics simulation so I can't simply idle screen redraws when the user isn't interacting with the UI).

Line 47-49 set up the needed events:

    http://git.sugarlabs.org/physics/mainline/blobs/master/activity.py#line47

Thanks for thinking about your activity power usage, not much learning can happen on a laptop with a flat battery!

Regards,
--Gary

> It doesn't happen with my Mirabelle SoaS.
> 
> Here's a sample activity with this problem:
> 
> http://activities.sugarlabs.org/en-US/sugar/addon/4371
> 
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel


More information about the Sugar-devel mailing list