emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a232a8a22c 1/2: Implement `haiku_delete_terminal'


From: Po Lu
Subject: master a232a8a22c 1/2: Implement `haiku_delete_terminal'
Date: Sun, 20 Mar 2022 01:55:26 -0400 (EDT)

branch: master
commit a232a8a22c6a228d871ff8df7cd25b0cabe3e5fb
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Implement `haiku_delete_terminal'
    
    * src/haikuterm.c (haiku_delete_terminal): Actually delete the
    terminal instead of aborting.
---
 src/haikuterm.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/haikuterm.c b/src/haikuterm.c
index 4ae64129ef..221bdfd2ee 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -115,7 +115,25 @@ haiku_toolkit_position (struct frame *f, int x, int y,
 static void
 haiku_delete_terminal (struct terminal *terminal)
 {
-  emacs_abort ();
+  struct haiku_display_info *dpyinfo = terminal->display_info.haiku;
+  struct terminal *t;
+
+  if (!terminal->name)
+    return;
+
+  block_input ();
+  be_app_quit ();
+
+  /* Close all frames and delete the generic struct terminal.  */
+  for (t = terminal_list; t; t = t->next_terminal)
+    {
+      if (t->type == output_haiku && t->display_info.haiku == dpyinfo)
+       {
+         delete_terminal (t);
+         break;
+       }
+    }
+  unblock_input ();
 }
 
 static const char *



reply via email to

[Prev in Thread] Current Thread [Next in Thread]