diff --git a/sugar/browser/BrowserShell.py b/sugar/browser/BrowserShell.py index c801e5ce..42f2ccd4 100644 --- a/sugar/browser/BrowserShell.py +++ b/sugar/browser/BrowserShell.py @@ -30,17 +30,20 @@ class BrowserShell(dbus.service.Object): links.append(link) return links - def _start_browser_cb(self, browser): - browser.connect_to_shell() + def _start_browser_cb(self, browser, activity_id): + if activity_id: + browser.connect_to_shell(activity_id) + else: + browser.connect_to_shell() @dbus.service.method('com.redhat.Sugar.BrowserShell') def open_browser(self, uri): browser = BrowserActivity(uri) self.__browsers.append(browser) - gobject.idle_add(self._start_browser_cb, browser) + gobject.idle_add(self._start_browser_cb, browser, None) @dbus.service.method('com.redhat.Sugar.BrowserShell') def open_browser_with_id(self, uri, activity_id): browser = BrowserActivity(uri) self.__browsers.append(browser) - browser.connect_to_shell(activity_id) + gobject.idle_add(self._start_browser_cb, browser, activity_id)