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:
parent
a412787d69
commit
06278ee7f1
1 changed files with 3 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue