Fix tab auto focus on TabCloseForce

Auto focus should only trigger if the current tab is selected or else
closing an unfocused tab would move the focused tab.

See: pop-os/cosmic-files#1949
This commit is contained in:
Josh Megnauth 2026-08-01 20:11:53 -04:00
parent 4ac0da3af9
commit e4006945c6
No known key found for this signature in database
GPG key ID: 70813183462EFAD3

View file

@ -2787,7 +2787,9 @@ impl Application for App {
}
Message::TabCloseForce(entity) => {
// Activate closest item
if let Some(position) = self.tab_model.position(entity) {
if self.tab_model.active() == entity
&& let Some(position) = self.tab_model.position(entity)
{
if position > 0 {
self.tab_model.activate_position(position - 1);
} else {