From 0de9e15c84eec759056bbc6228cccc0d242d1b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Wed, 14 Oct 2026 17:56:10 -0400 Subject: [PATCH] T11: the Workspace key context sits above the focus root, so the column toggles work after a press on a blank column or a header --- src/workspace.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/workspace.rs b/src/workspace.rs index 06f18a0..9f1490d 100644 --- a/src/workspace.rs +++ b/src/workspace.rs @@ -118,22 +118,22 @@ impl Render for Workspace { if settings.show_panel { shell = shell.column(ShellColumn::new("panel").width(width)); } - ResizeBorder::new().child( - FocusScope::new(&self.focus).root().size_full().child( - div() - .size_full() - .key_context(CONTEXT) - .on_action(cx.listener(|this, _: &ToggleSessions, _, cx| { - this.toggle( - |settings| settings.show_sessions = !settings.show_sessions, - cx, - ) - })) - .on_action(cx.listener(|this, _: &TogglePanel, _, cx| { - this.toggle(|settings| settings.show_panel = !settings.show_panel, cx) - })) - .child(shell), - ), - ) + // The context sits above the focus root, so its keys work wherever focus is. + div() + .size_full() + .key_context(CONTEXT) + .on_action(cx.listener(|this, _: &ToggleSessions, _, cx| { + this.toggle( + |settings| settings.show_sessions = !settings.show_sessions, + cx, + ) + })) + .on_action(cx.listener(|this, _: &TogglePanel, _, cx| { + this.toggle(|settings| settings.show_panel = !settings.show_panel, cx) + })) + .child( + ResizeBorder::new() + .child(FocusScope::new(&self.focus).root().size_full().child(shell)), + ) } }