[Sugar-devel] Web Activity lifecycle and storage

Daniel Narvaez dwnarvaez at gmail.com
Sat Aug 3 05:46:42 EDT 2013


On 3 August 2013 02:26, Manuel Quiñones <manuq at laptop.org> wrote:

>
> The problem is: how could the activity process wait for the datastore
> write to finish?  If the WnckWindow close is called [1], the activity
> process ends.  Unless you connect a callback to 'delete-event' [2] and
> handle the destroy() yourself [3] .  Which is what GTK activities do
> to store before closing.
>

The shell currently does

activity.get_window().close()

We could

1 Add a close method to Activity directly. That would emit a close signal
and call get_window().close() only if the signal didn't return True.
2 Apisocket would connect to that signal, send the stop notification to the
web activity and return True.
3 On stop the activity would first save state, then call activity.close().

I think it would be possible to implement something like delete-event too,
but the implementation would be slightly more complicated (close becomes
async). And anyway, API wise, just letting the activity close() itself
seems cleaner to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130803/6f8269ef/attachment.html>


More information about the Sugar-devel mailing list