Handle closing all activities correctly

This commit is contained in:
Marco Pesenti Gritti 2006-09-21 15:16:36 +02:00
parent 229793e9f0
commit af54df80ec

View File

@ -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