We have this code in many places, I found it in the Distance activity and bitfrost updater. <br>May be is a good idea inhibit suspend when is displayed the neighborhood view also.<br>Can we have a unique class like PowerManager or anything like that?<br>
Regards<br><br>Gonzalo <br> <br><br><div class="gmail_quote">On Thu, Sep 16, 2010 at 8:23 PM, James Cameron <span dir="ltr"><<a href="mailto:quozl@laptop.org">quozl@laptop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Thu, Sep 16, 2010 at 05:38:29PM -0400, Martin Langhoff wrote:<br>
> 2 - hack the Tubes/Telepathy stack to _prevent sleep_ while an actual<br>
> collaboration session is running<br>
<br>
</div>This might help. Once an activity is shared, the laptop stays awake<br>
until the activity is stopped.<br>
<br>
(sugar-toolkit.git)<br>
--- a/src/sugar/activity/activity.py<br>
+++ b/src/sugar/activity/activity.py<br>
@@ -916,6 +916,14 @@ class Activity(Window, gtk.Container):<br>
self._share_id = self._pservice.connect("activity-shared",<br>
self.__share_cb)<br>
self._pservice.share_activity(self, private=private)<br>
+ # inhibit suspend during sharing<br>
+ path = '/var/run/powerd-inhibit-suspend/%s' % os.getpid()<br>
+ try:<br>
+ fd = open(path, 'w')<br>
+ except IOError:<br>
+ pass<br>
+ else:<br>
+ fd.close()<br>
<br>
def _show_keep_failed_dialog(self):<br>
alert = Alert()<br>
<font color="#888888"><br>
--<br>
James Cameron<br>
<a href="http://quozl.linux.org.au/" target="_blank">http://quozl.linux.org.au/</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.laptop.org">Devel@lists.laptop.org</a><br>
<a href="http://lists.laptop.org/listinfo/devel" target="_blank">http://lists.laptop.org/listinfo/devel</a><br>
</div></div></blockquote></div><br>