From 734bd9841ad3d35c30ae34546f6f6d1215a260a4 Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Wed, 2 Jun 2021 12:28:52 +0200 Subject: [PATCH] Terminal: Close find & settings windows on application exit Since the find & settings windows are not children of the main window, they stayed open after exiting the application. --- Userland/Applications/Terminal/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 7704e02386..50fe3002a5 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -393,6 +393,13 @@ int main(int argc, char** argv) window->set_menubar(menubar); + window->on_close = [&]() { + if (find_window) + find_window->close(); + if (settings_window) + settings_window->close(); + }; + if (unveil("/res", "r") < 0) { perror("unveil"); return 1;