Skip to content

Commit 06278ee

Browse files
joshuamegnauth54jacobgkau
authored andcommitted
Change focus only if selected tab is closed
Closes: #1921 Closing a tab other than the focused tab shouldn't change the focus.
1 parent a412787 commit 06278ee

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/app.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4466,7 +4466,9 @@ impl Application for App {
44664466
tasks.push(Task::future(async move {
44674467
cosmic::action::app(Message::WindowClose)
44684468
}));
4469-
} else if let Some(position) = self.tab_model.position(entity) {
4469+
} else if entity == self.tab_model.active()
4470+
&& let Some(position) = self.tab_model.position(entity)
4471+
{
44704472
let new_position = if position > 0 {
44714473
position - 1
44724474
} else {

0 commit comments

Comments
 (0)