From 06278ee7f178a974d79e9603264fefaab1756882 Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Fri, 31 Jul 2026 22:20:17 -0400 Subject: [PATCH] Change focus only if selected tab is closed Closes: #1921 Closing a tab other than the focused tab shouldn't change the focus. --- src/app.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index 6a7bf63..48f70bb 100644 --- a/src/app.rs +++ b/src/app.rs @@ -4466,7 +4466,9 @@ impl Application for App { tasks.push(Task::future(async move { cosmic::action::app(Message::WindowClose) })); - } else if let Some(position) = self.tab_model.position(entity) { + } else if entity == self.tab_model.active() + && let Some(position) = self.tab_model.position(entity) + { let new_position = if position > 0 { position - 1 } else {