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
This commit is contained in:
parent
c8fa6bd694
commit
d45560e3c7
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user