From 880842dd8616a646edfece856b1213c22ce3f94a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 17 Nov 2006 15:07:53 -0500 Subject: [PATCH] don't kill the shell when a non-activity window is brought to front (cherry picked from 5f03e1deb014d91af7deea5051011a67bc2dde5c commit) --- shell/view/Shell.py | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/shell/view/Shell.py b/shell/view/Shell.py index 3d942ba0..585f4806 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 - self.emit('activity-closed', host) - del self._hosts[window.get_xid()] + 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()] if len(self._hosts) == 0: self._set_current_activity(None)