diff options
author | Dan Williams <dcbw@localhost.localdomain> | 2006-11-17 20:07:53 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@localhost.localdomain> | 2006-11-17 20:07:53 (GMT) |
commit | 5f03e1deb014d91af7deea5051011a67bc2dde5c (patch) | |
tree | 829b07f0968b273a470b8134bdf2389bfc873144 | |
parent | b18600d83d693ee8273d5345955e5d00ec8f7f8e (diff) |
don't kill the shell when a non-activity window is brought to front
-rw-r--r-- | shell/view/Shell.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/shell/view/Shell.py b/shell/view/Shell.py index 3d942ba..585f480 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -134,23 +134,30 @@ class Shell(gobject.GObject): def __active_window_changed_cb(self, screen): window = screen.get_active_window() + if not window or window.get_window_type() != wnck.WINDOW_NORMAL: + return + if not self._hosts.has_key(window.get_xid()): + return - if window and window.get_window_type() == wnck.WINDOW_NORMAL: - activity_host = self._hosts[window.get_xid()] - current = self._model.get_current_activity() - if activity_host.get_id() == current: - return + activity_host = self._hosts[window.get_xid()] + current = self._model.get_current_activity() + if activity_host.get_id() == current: + return - self._set_current_activity(activity_host) + self._set_current_activity(activity_host) def __window_closed_cb(self, screen, window): - if window.get_window_type() == wnck.WINDOW_NORMAL: - if self._hosts.has_key(window.get_xid()): - host = self._hosts[window.get_xid()] - host.destroy() + if window.get_window_type() != wnck.WINDOW_NORMAL: + return + + if not self._hosts.has_key(window.get_xid()): + return + + host = self._hosts[window.get_xid()] + host.destroy() - self.emit('activity-closed', host) - del self._hosts[window.get_xid()] + self.emit('activity-closed', host) + del self._hosts[window.get_xid()] if len(self._hosts) == 0: self._set_current_activity(None) |