<div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>
</div>In Sugar, there&#39;s always one and only one active activity. You can see<br>
which it is by looking at the icon below the XO in the favorites view<br>
or by looking at the selected activity button in the top frame. This<br>
is the activity that will be brought to the front when you go to the<br>
Activity zoom level.<br>
<br>
I&#39;m guessing Measure uses its &quot;active activity&quot; status to decide if it<br>
should update itself or not, but from earlier emails I think the<br>
desired behavior is rather to stop updating while the activity window<br>
is not visible. For this, the activity author can use the information<br>
that the window manager (or is it X?) provides to each top level<br>
window, in pygtk:<br>
<br>
<a href="http://pygtk.org/docs/pygtk/class-gtkwidget.html#signal-gtkwidget--visibility-notify-event" target="_blank">http://pygtk.org/docs/pygtk/class-gtkwidget.html#signal-gtkwidget--visibility-notify-event</a><br>
<br>
Just listen for that signal and check the value of event.state, it can<br>
be one of gtk.gdk.VISIBILITY_FULLY_OBSCURED,<br>
gtk.gdk.VISIBILITY_PARTIAL or gtk.gdk.VISIBILITY_UNOBSCURED. You will<br>
want to stop updating the screen when fully obscured and update it<br>
otherwise.<br>
<br>
Faisal, could you please update the almanac with this info?<br>
</blockquote><div><br>The basics of this idea are in the almanac:<br><br><div style="margin-left: 40px;"><a href="http://wiki.laptop.org/go/Sugar_Almanac#How_do_I_know_when_my_activity_is_.22active.22_or_not.3F">http://wiki.laptop.org/go/Sugar_Almanac#How_do_I_know_when_my_activity_is_.22active.22_or_not.3F</a><br>
</div><br></div></div></div>