Переглянути джерело

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.
Marcus Nilsson 4 роки тому
батько
коміт
734bd9841a
1 змінених файлів з 7 додано та 0 видалено
  1. 7 0
      Userland/Applications/Terminal/main.cpp

+ 7 - 0
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;