diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-12-14 22:38:32 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-12-14 22:38:32 (GMT) |
commit | 6c2607d000be56a50df1419cbfe997b591ec267f (patch) | |
tree | ff81b020c1bbbce8b30dc19976df7f9da85e19bd /shell | |
parent | cc2558abec6ea8902c4440d50f46efd9eae27a24 (diff) | |
parent | 5103f1fb27fcfa0153caf5e6b76e59a48f08df36 (diff) |
Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
Diffstat (limited to 'shell')
-rwxr-xr-x | shell/sugar-shell | 12 | ||||
-rw-r--r-- | shell/view/Shell.py | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/shell/sugar-shell b/shell/sugar-shell index 1620aa3..67c8029 100755 --- a/shell/sugar-shell +++ b/shell/sugar-shell @@ -44,6 +44,15 @@ if not name or not len(name): dialog.run() profile.update() +# Save our DBus Session Bus address somewhere it can be found +# +# WARNING!!! this is going away at some near future point, do not rely on it +# +dsba_file = os.path.join(env.get_profile_path(), "session_bus_address") +f = open(dsba_file, "w") +f.write(os.environ["DBUS_SESSION_BUS_ADDRESS"]) +f.close() + model = ShellModel() shell = Shell(model) @@ -53,10 +62,11 @@ args = ["sugar-nm-applet"] flags = gobject.SPAWN_SEARCH_PATH result = gobject.spawn_async(args, flags=flags, standard_output=False) - tbh = TracebackUtils.TracebackHelper() try: gtk.main() except KeyboardInterrupt: print 'Ctrl+C pressed, exiting...' del tbh + +os.remove(dsba_file) diff --git a/shell/view/Shell.py b/shell/view/Shell.py index 15f1eee..4637499 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -14,9 +14,12 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +import logging + import gtk import gobject import wnck +import dbus import view.stylesheet from sugar.graphics import style @@ -125,7 +128,14 @@ class Shell(gobject.GObject): def __window_opened_cb(self, screen, window): if window.get_window_type() == wnck.WINDOW_NORMAL: - activity_host = ActivityHost(self.get_model(), window) + try: + activity_host = ActivityHost(self.get_model(), window) + except dbus.DBusException: + logging.debug('Shell.__window_opened_cb: opened unknown window ' + + window.get_name() + ' with xid ' + + str(window.get_xid())) + return + self._hosts[activity_host.get_xid()] = activity_host self.emit('activity-opened', activity_host) |