Handle closing all activities correctly
This commit is contained in:
parent
229793e9f0
commit
af54df80ec
@ -81,10 +81,7 @@ class Shell(gobject.GObject):
|
|||||||
def __active_window_changed_cb(self, screen):
|
def __active_window_changed_cb(self, screen):
|
||||||
window = screen.get_active_window()
|
window = screen.get_active_window()
|
||||||
|
|
||||||
if window == None:
|
if window and window.get_window_type() == wnck.WINDOW_NORMAL:
|
||||||
self._model.set_current_activity(None)
|
|
||||||
self.emit('activity-changed', None)
|
|
||||||
elif window.get_window_type() == wnck.WINDOW_NORMAL:
|
|
||||||
activity_host = self._hosts[window.get_xid()]
|
activity_host = self._hosts[window.get_xid()]
|
||||||
|
|
||||||
current = self._model.get_current_activity()
|
current = self._model.get_current_activity()
|
||||||
@ -101,6 +98,10 @@ class Shell(gobject.GObject):
|
|||||||
self.emit('activity-closed', host)
|
self.emit('activity-closed', host)
|
||||||
del self._hosts[window.get_xid()]
|
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):
|
def get_model(self):
|
||||||
return self._model
|
return self._model
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user