mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
fix: Prevent terminal from stealing modal focus.
This commit is contained in:
parent
aeb5d6d7ff
commit
eaa430843c
1 changed files with 10 additions and 1 deletions
|
|
@ -317,7 +317,8 @@ impl TerminalPanel {
|
||||||
if let Some(workspace) = workspace.upgrade() {
|
if let Some(workspace) = workspace.upgrade() {
|
||||||
let should_focus = workspace
|
let should_focus = workspace
|
||||||
.update_in(&mut cx, |workspace, window, cx| {
|
.update_in(&mut cx, |workspace, window, cx| {
|
||||||
workspace.active_item(cx).is_none()
|
!workspace.has_active_modal(window, cx)
|
||||||
|
&& workspace.active_item(cx).is_none()
|
||||||
&& workspace
|
&& workspace
|
||||||
.is_dock_at_position_open(terminal_panel.position(window, cx), cx)
|
.is_dock_at_position_open(terminal_panel.position(window, cx), cx)
|
||||||
})
|
})
|
||||||
|
|
@ -905,6 +906,14 @@ impl TerminalPanel {
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
let reveal_strategy = if workspace.has_active_modal(window, cx)
|
||||||
|
&& matches!(reveal_strategy, RevealStrategy::Always)
|
||||||
|
{
|
||||||
|
RevealStrategy::NoFocus
|
||||||
|
} else {
|
||||||
|
reveal_strategy
|
||||||
|
};
|
||||||
|
|
||||||
match reveal_strategy {
|
match reveal_strategy {
|
||||||
RevealStrategy::Always => {
|
RevealStrategy::Always => {
|
||||||
workspace.focus_panel::<Self>(window, cx);
|
workspace.focus_panel::<Self>(window, cx);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue