Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorDan Williams <dcbw@localhost.localdomain>2006-11-17 20:07:53 (GMT)
committer Dan Williams <dcbw@localhost.localdomain>2006-11-17 20:31:53 (GMT)
commit880842dd8616a646edfece856b1213c22ce3f94a (patch)
tree9d7d442e017d3047bd56a9571b3f8e120535146f /shell
parent0c47294dbd22fa14c922ce2d66a278777a1adf09 (diff)
don't kill the shell when a non-activity window is brought to front
(cherry picked from 5f03e1deb014d91af7deea5051011a67bc2dde5c commit)
Diffstat (limited to 'shell')
-rw-r--r--shell/view/Shell.py31
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)