From bbde1438e9c31cc83d8c4835ea97a0eaeae4e192 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 5 Apr 2025 23:45:55 +0530 Subject: Close window when no tabs left --- src/widgets/WebViewStack.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/widgets/WebViewStack.cpp') diff --git a/src/widgets/WebViewStack.cpp b/src/widgets/WebViewStack.cpp index ae95ea6..8c432f1 100644 --- a/src/widgets/WebViewStack.cpp +++ b/src/widgets/WebViewStack.cpp @@ -125,13 +125,12 @@ void WebViewStack::close(WebViewId webview_id) { disconnect(webview->page()); webview->deleteLater(); - // TODO: Focus on different webview - // focus_webview(); - - // TODO: Close window on empty if (webview_list.isEmpty()) { - // window()->close(); - create_new_webview(configuration->new_tab_url, true); + if (configuration->close_window_when_no_tabs) { + emit close_window_requested(); + } else { + create_new_webview(configuration->new_tab_url, true); + } } } -- cgit v1.3.1