Change focus only if selected tab is closed

Closes: #1921

Closing a tab other than the focused tab shouldn't change the focus.
This commit is contained in:
Josh Megnauth 2026-07-31 22:20:17 -04:00 • committed by Jacob Kauffmann
parent a412787d69
commit 06278ee7f1

View file

@ -4466,7 +4466,9 @@ impl Application for App {
tasks.push(Task::future(async move { tasks.push(Task::future(async move {
cosmic::action::app(Message::WindowClose) 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 { let new_position = if position > 0 {
position - 1 position - 1
} else { } else {