diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-09-10 09:12:05 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-09-10 09:12:05 (GMT) |
commit | d1b5fb8dc528be407f7ecc3c95106c61a15fee15 (patch) | |
tree | 306faac0b6f14073ac95d7747aff1225266a71e8 /shell | |
parent | f7a1900d3d5313fd7adb96b3061734c80980c04b (diff) |
Handle activating windows which are transient to the activity.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/model/homemodel.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/shell/model/homemodel.py b/shell/model/homemodel.py index 54378ec..1455009 100644 --- a/shell/model/homemodel.py +++ b/shell/model/homemodel.py @@ -184,15 +184,17 @@ class HomeModel(gobject.GObject): def _active_window_changed_cb(self, screen): window = screen.get_active_window() - if window is None or window.get_window_type() != wnck.WINDOW_NORMAL: + if window is None: return - xid = window.get_xid() - act = self._get_activity_by_xid(xid) - if act is None: - logging.error('Model for window %d does not exist.' % xid) - self._set_pending_activity(act) - self._set_active_activity(act) + if window.get_window_type() != wnck.WINDOW_DIALOG: + while window.get_transient() is not None: + window = window.get_transient() + + activity = self._get_activity_by_xid(window.get_xid()) + if activity is not None: + self._set_pending_activity(activity) + self._set_active_activity(activity) def _add_activity(self, home_activity): self._activities.append(home_activity) |