Don't quit the neighbour when switching to an already-open profile
Clicking a profile quit every other running one first, unconditionally — including when the profile clicked was already open. The menu lists every running profile at once, so the click that reaches for the second one is almost always someone moving between two open windows, and it cost them a relaunch and whatever was on screen to carry out an instruction nobody gave. Switching now only quits anything when the target isn't up yet. An already-running profile is simply brought forward, which is what shift-click did and what the click on a running profile always looked like it would do.
This commit is contained in:
@@ -360,7 +360,19 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate, LiveSt
|
||||
}
|
||||
}
|
||||
|
||||
// Switching means "make this the one that's running" — so it only has to
|
||||
// quit anything when the profile isn't up yet. Clicking one that's
|
||||
// already open is a request to look at it, not to tear down the window
|
||||
// beside it: the menu shows every running profile at once, so the click
|
||||
// that reaches for the second one is almost always someone moving
|
||||
// between two open windows rather than asking for one of them to go.
|
||||
// Quitting the neighbour there costs a relaunch and whatever was on
|
||||
// screen, to carry out an instruction nobody gave.
|
||||
private func switchTo(_ profile: ResolvedProfile) {
|
||||
guard !currentInfos.contains(where: { $0.profile.name == profile.name && $0.running }) else {
|
||||
openProfile(profile)
|
||||
return
|
||||
}
|
||||
let others = currentInfos.filter { $0.running && $0.profile.name != profile.name }
|
||||
guard !others.isEmpty else { openProfile(profile); return }
|
||||
var remaining = others.count
|
||||
|
||||
Reference in New Issue
Block a user