diff --git a/composer.go b/composer.go
index <HASH>..<HASH> 100644
--- a/composer.go
+++ b/composer.go
@@ -584,6 +584,8 @@ func (c *Composer) processKey(ev Event) {
 
 func ProcessEvent(ev Event) {
 	switch ev.Type {
+	case EventCloseWindow:
+		comp.closeTopWindow()
 	case EventRedraw:
 		RefreshScreen()
 	case EventResize:
diff --git a/consts.go b/consts.go
index <HASH>..<HASH> 100644
--- a/consts.go
+++ b/consts.go
@@ -286,6 +286,8 @@ const (
 	EventDialogClose
 	// Close application
 	EventQuit
+    // Close top window - or application is there is only one window
+    EventCloseWindow
 )
 
 // ConfirmationDialog and SelectDialog exit codes
add event for composer to close the top window