Focus floating chat from terminal shortcut
Raise the most recently used chat when Ctrl+Y is invoked from another window, then rely on the existing host lifecycle to focus its composer. Preserve toggle behavior while chat is active and retain the Apple shortcut aliases.
This commit is contained in:
@@ -289,6 +289,20 @@ class WindowManager extends ChangeNotifier {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Hides the group when it is active; otherwise shows and raises its most
|
||||
/// recently used window. A global shortcut should bring a group forward when
|
||||
/// pressed from another window, rather than hide it behind that window.
|
||||
bool toggleOrRaiseGroup(String groupId) {
|
||||
final group = inGroup(groupId).toList();
|
||||
if (group.isEmpty) return false;
|
||||
if (group.any(isVisible) && active?.groupId == groupId) {
|
||||
setGroupShown(groupId, false);
|
||||
} else {
|
||||
show(group.last.id);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Brings the next ([step] 1) or previous (-1) visible window to the top.
|
||||
void cycle([int step = 1]) {
|
||||
final visible = windows.where(isVisible).toList();
|
||||
|
||||
Reference in New Issue
Block a user