From af54df80ec90aafc4912b831424ac74a975547c1 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 21 Sep 2006 15:16:36 +0200 Subject: [PATCH] Handle closing all activities correctly --- shell/view/Shell.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shell/view/Shell.py b/shell/view/Shell.py index f95cf313..9eb8d469 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