From 5766522f530582d4b73b87fff76a67ebadebbb1c Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Fri, 7 Sep 2007 17:39:42 +0200 Subject: [PATCH] Fix for removing activity from donut when not the active and the last one --- shell/model/homemodel.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shell/model/homemodel.py b/shell/model/homemodel.py index 759c2b8c..54378ec3 100644 --- a/shell/model/homemodel.py +++ b/shell/model/homemodel.py @@ -201,7 +201,9 @@ class HomeModel(gobject.GObject): def _remove_activity(self, home_activity): if home_activity == self._active_activity: self._set_active_activity(None) - # Figure out the new _pending_activity. + + if home_activity == self._pending_activity: + # Figure out the new _pending_activity windows = wnck.screen_get_default().get_windows_stacked() windows.reverse() for window in windows: @@ -209,13 +211,13 @@ class HomeModel(gobject.GObject): if new_activity is not None: self._set_pending_activity(new_activity) break - else: + else: logging.error('No activities are running') self._set_pending_activity(None) self.emit('activity-removed', home_activity) self._activities.remove(home_activity) - + def _remove_activity_by_xid(self, xid): home_activity = self._get_activity_by_xid(xid) if home_activity: