diff --git a/shell/view/ActivityHost.py b/shell/view/ActivityHost.py index 4524f563..43ed38ce 100644 --- a/shell/view/ActivityHost.py +++ b/shell/view/ActivityHost.py @@ -96,11 +96,15 @@ class ActivityHost: dialog.show() dialog.window.set_transient_for(self._gdk_window) - def chat_show(self): + def chat_show(self, frame_was_visible): self._chat_window.show_all() + self._frame_was_visible = frame_was_visible def chat_hide(self): self._chat_window.hide() + wasvis = self._frame_was_visible + self._frame_was_visible = False + return wasvis def is_chat_visible(self): return self._chat_window.get_property('visible') @@ -108,8 +112,10 @@ class ActivityHost: def _activity_changed_cb(self, shell, activity): if activity != self: self.chat_hide() + self._frame_was_visible = False def _activity_closed_cb(self, shell, activity): if activity == self: self.chat_hide() + self._frame_was_visible = False diff --git a/shell/view/Shell.py b/shell/view/Shell.py index e5274b80..c9a2c4da 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -153,8 +153,14 @@ class Shell(gobject.GObject): def _show_hide_activity_chat(self): act = self.get_current_activity() - if act: - if act.is_chat_visible(): - act.chat_hide() - else: - act.chat_show() + if not act: + return + is_visible = self._frame.is_visible() + if act.is_chat_visible(): + frame_was_visible = act.chat_hide() + if not frame_was_visible: + self._frame.do_slide_out() + else: + if not is_visible: + self._frame.do_slide_in() + act.chat_show(is_visible)