Handle activating windows which are transient to the activity.

This commit is contained in:
Marco Pesenti Gritti 2007-09-10 11:12:05 +02:00
parent f7a1900d3d
commit d1b5fb8dc5

View File

@ -184,15 +184,17 @@ class HomeModel(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 is None or window.get_window_type() != wnck.WINDOW_NORMAL: if window is None:
return return
xid = window.get_xid() if window.get_window_type() != wnck.WINDOW_DIALOG:
act = self._get_activity_by_xid(xid) while window.get_transient() is not None:
if act is None: window = window.get_transient()
logging.error('Model for window %d does not exist.' % xid)
self._set_pending_activity(act) activity = self._get_activity_by_xid(window.get_xid())
self._set_active_activity(act) if activity is not None:
self._set_pending_activity(activity)
self._set_active_activity(activity)
def _add_activity(self, home_activity): def _add_activity(self, home_activity):
self._activities.append(home_activity) self._activities.append(home_activity)