diff --git a/shell/view/Shell.py b/shell/view/Shell.py index f4ba70cd..a5985a23 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -40,10 +40,13 @@ class Shell(gobject.GObject): self._key_handler = KeyHandler(self) self._popup_context = PopupContext() + self._frame = Frame(self) + self._frame.show() self._home_window = HomeWindow(self) self._home_window.show() + self._zoom_level = sugar.ZOOM_HOME home_model = self._model.get_home() @@ -58,6 +61,8 @@ class Shell(gobject.GObject): activity_host = ActivityHost(home_activity) self._hosts[activity_host.get_xid()] = activity_host + self._frame.hide() + def _activity_removed_cb(self, home_model, home_activity): if not home_activity.get_launched(): return @@ -80,6 +85,8 @@ class Shell(gobject.GObject): if self._current_host: self._current_host.set_active(True) + self._zoom_level = sugar.ZOOM_ACTIVITY + def get_model(self): return self._model @@ -135,15 +142,25 @@ class Shell(gobject.GObject): self.set_zoom_level(sugar.ZOOM_HOME) def set_zoom_level(self, level): - self._zoom_level = level - self._update_zoom_level() + if self._zoom_level == level: + return + if len(self._hosts) == 0 and level == sugar.ZOOM_ACTIVITY: + return - def _update_zoom_level(self): - if level == sugar.ZOOM_ACTIVITY: + if self._zoom_level == sugar.ZOOM_HOME: + self._frame.restore_state() + + self._zoom_level = level + + if self._zoom_level == sugar.ZOOM_ACTIVITY: self._screen.toggle_showing_desktop(False) else: self._screen.toggle_showing_desktop(True) - self._home_window.set_zoom_level(level) + self._home_window.set_zoom_level(self._zoom_level) + + if self._zoom_level == sugar.ZOOM_HOME: + self._frame.save_state() + self._frame.show() def get_current_activity(self): return self._current_host diff --git a/shell/view/frame/ActivitiesBox.py b/shell/view/frame/ActivitiesBox.py index 1466ff44..8fcddf86 100644 --- a/shell/view/frame/ActivitiesBox.py +++ b/shell/view/frame/ActivitiesBox.py @@ -76,7 +76,6 @@ class ActivitiesBox(hippo.CanvasBox): self._invites.connect('invite-removed', self._invite_removed_cb) def _activity_clicked_cb(self, icon): - self._shell.get_frame().hide() self._shell.start_activity(icon.get_bundle_id()) def _invite_clicked_cb(self, icon): diff --git a/shell/view/frame/frame.py b/shell/view/frame/frame.py index 51a80326..c34a85d7 100644 --- a/shell/view/frame/frame.py +++ b/shell/view/frame/frame.py @@ -155,11 +155,16 @@ class Frame(object): self._key_listener = _KeyListener(self) self._mouse_listener = _MouseListener(self) + self.save_state() + def save_state(self): self._saved_state = _FrameState(self.visible, self.mode) def restore_state(self): - if self.saved_state.visible: + if self._saved_state == None: + return + + if self._saved_state.visible: self.show() else: self.hide()