diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-21 13:16:36 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-09-21 13:16:36 (GMT) |
commit | af54df80ec90aafc4912b831424ac74a975547c1 (patch) | |
tree | eae098596d88be556adc97c3d6b3b9665899b372 | |
parent | 229793e9f0b600da7a5c6bfd8b92de7925039ecf (diff) |
Handle closing all activities correctly
-rw-r--r-- | shell/view/Shell.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/shell/view/Shell.py b/shell/view/Shell.py index f95cf31..9eb8d46 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -81,10 +81,7 @@ class Shell(gobject.GObject): def __active_window_changed_cb(self, screen): window = screen.get_active_window() - if window == None: - self._model.set_current_activity(None) - self.emit('activity-changed', None) - elif window.get_window_type() == wnck.WINDOW_NORMAL: + if window and window.get_window_type() == wnck.WINDOW_NORMAL: activity_host = self._hosts[window.get_xid()] current = self._model.get_current_activity() @@ -101,6 +98,10 @@ class Shell(gobject.GObject): self.emit('activity-closed', host) del self._hosts[window.get_xid()] + if len(self._hosts) == 0: + self._model.set_current_activity(None) + self.emit('activity-changed', None) + def get_model(self): return self._model |