From d45560e3c7aa33e281b6dc374392d7e31f44177a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Wed, 21 Aug 2013 13:23:13 -0300 Subject: [PATCH] Web activity: quit the GTK main loop when activity is destroyed Fixes #4603 . In GTK activities, this is done by _ActivitySession when the activity unregisters itself, in _complete_close method. Making the web activity aware of session logout will be handled in another patch for the shell, see http://bugs.sugarlabs.org/ticket/4611 --- src/sugar3/activity/webactivity.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sugar3/activity/webactivity.py b/src/sugar3/activity/webactivity.py index 5ba17cea..8952813a 100644 --- a/src/sugar3/activity/webactivity.py +++ b/src/sugar3/activity/webactivity.py @@ -44,6 +44,7 @@ class WebActivity(Gtk.Window): self.connect("key-press-event", self._key_press_event_cb) self.connect('realize', self._realize_cb) + self.connect('destroy', self._destroy_cb) context = WebKit2.WebContext.get_default() context.register_uri_scheme("activity", self._app_scheme_cb, None) @@ -69,6 +70,10 @@ class WebActivity(Gtk.Window): SugarExt.wm_set_bundle_id(xid, self._bundle_id) SugarExt.wm_set_activity_id(xid, str(self._activity_id)) + def _destroy_cb(self, window): + self.destroy() + Gtk.main_quit() + def _loading_changed_cb(self, web_view, load_event): if load_event == WebKit2.LoadEvent.FINISHED: key = os.environ["SUGAR_APISOCKET_KEY"]