#10363 NORM 10.1.3: Auto-Suspend gets in the way when sharing over Salut

Gonzalo Odiard gonzalo at laptop.org
Tue Sep 28 15:43:06 EDT 2010


We have this code in many places, I found it in the Distance activity and
bitfrost updater.
May be is a good idea inhibit suspend when is displayed the neighborhood
view also.
Can we have a unique class like PowerManager or anything like that?
Regards

Gonzalo


On Thu, Sep 16, 2010 at 8:23 PM, James Cameron <quozl at laptop.org> wrote:

> On Thu, Sep 16, 2010 at 05:38:29PM -0400, Martin Langhoff wrote:
> > 2 - hack the Tubes/Telepathy stack to _prevent sleep_ while an actual
> > collaboration session is running
>
> This might help.  Once an activity is shared, the laptop stays awake
> until the activity is stopped.
>
> (sugar-toolkit.git)
> --- a/src/sugar/activity/activity.py
> +++ b/src/sugar/activity/activity.py
> @@ -916,6 +916,14 @@ class Activity(Window, gtk.Container):
>         self._share_id = self._pservice.connect("activity-shared",
>                                                 self.__share_cb)
>         self._pservice.share_activity(self, private=private)
> +        # inhibit suspend during sharing
> +        path = '/var/run/powerd-inhibit-suspend/%s' % os.getpid()
> +        try:
> +            fd = open(path, 'w')
> +        except IOError:
> +            pass
> +        else:
> +            fd.close()
>
>     def _show_keep_failed_dialog(self):
>         alert = Alert()
>
> --
> James Cameron
> http://quozl.linux.org.au/
> _______________________________________________
> Devel mailing list
> Devel at lists.laptop.org
> http://lists.laptop.org/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20100928/daf513d6/attachment.html>


More information about the Devel mailing list