From 64ca51265dcb4caf8bdd9051b3e63cf5b8e7518e Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Wed, 4 Aug 2021 22:28:11 +0200 Subject: [PATCH] Assistant: Quit the application after losing focus Prior to this change, Assistant would just stay in the background, unless one pressed an Escape key or launched some app. --- Userland/Applications/Assistant/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp index e68bfa8d03..50dd99b196 100644 --- a/Userland/Applications/Assistant/main.cpp +++ b/Userland/Applications/Assistant/main.cpp @@ -280,6 +280,10 @@ int main(int argc, char** argv) text_box.on_escape_pressed = []() { GUI::Application::the()->quit(); }; + window->on_active_window_change = [](bool is_active_window) { + if (!is_active_window) + GUI::Application::the()->quit(); + }; db.on_new_results = [&](auto results) { if (results.is_empty())