diff --git a/src/client/application/application-main-window.vala b/src/client/application/application-main-window.vala
index 01b7b9c6..e1e55d0e 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -1955,6 +1955,17 @@ public class Application.MainWindow :
return Gdk.EVENT_STOP;
}
+ [GtkCallback]
+ private void on_main_leaflet_visible_child_changed() {
+ if (main_leaflet.child_transition_running)
+ return;
+
+ if (main_leaflet.visible_child_name == "conversations" && main_leaflet.folded)
+ if (this.conversation_viewer.current_composer != null) {
+ this.conversation_viewer.current_composer.activate_close_action();
+ }
+ }
+
private void on_offline_infobar_response() {
this.info_bars.remove(this.offline_infobar);
}
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 37e93fb4..17430021 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -1361,6 +1361,11 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
}
}
+ /* Activate the close action */
+ public void activate_close_action() {
+ this.actions.activate_action(ACTION_CLOSE, null);
+ }
+
internal void set_mode(PresentationMode new_mode) {
this.current_mode = new_mode;
this.header.set_mode(new_mode);
diff --git a/ui/application-main-window.ui b/ui/application-main-window.ui
index fe66491b..cbaacbcf 100644
--- a/ui/application-main-window.ui
+++ b/ui/application-main-window.ui
@@ -29,6 +29,8 @@
True
True
over
+
+