From 1baa507d5e5bff7918b9b579f018fd74636797fe Mon Sep 17 00:00:00 2001
From: Good Guy <good1.2guy@gmail.com>
Date: Sun, 10 Jun 2018 18:11:59 -0600
Subject: [PATCH] repair gui close behavior

---
 cinelerra-5.1/cinelerra/pluginlv2ui.C | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/cinelerra-5.1/cinelerra/pluginlv2ui.C b/cinelerra-5.1/cinelerra/pluginlv2ui.C
index b8f99ab1..03e656d7 100644
--- a/cinelerra-5.1/cinelerra/pluginlv2ui.C
+++ b/cinelerra-5.1/cinelerra/pluginlv2ui.C
@@ -256,8 +256,11 @@ int PluginLV2ChildUI::run_ui()
 		if( hidden < 0 ) {
 			gui->top_level = 0;
 			reset_gui();
-			done = -1;
-			break;
+			if( !is_forked() ) {
+				done = -1;
+				break;
+			}
+			hidden = 1;
 		}
 		if( updates ) {
 			if( (updates & UPDATE_PORTS) )
-- 
2.26.2