diff options
| author | user <user@clank> | 2026-08-08 22:40:53 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-08 22:40:53 +0200 |
| commit | e7bb75d5b76ad4ffc9541aa126a788cad92010f7 (patch) | |
| tree | 2434e78e780d500bedf1a50a4a156da1b64beafb | |
| parent | sl0p: grayscale the contents of unfocused panes (diff) | |
| download | sl0ppij-e7bb75d5b76ad4ffc9541aa126a788cad92010f7.tar.gz sl0ppij-e7bb75d5b76ad4ffc9541aa126a788cad92010f7.tar.xz sl0ppij-e7bb75d5b76ad4ffc9541aa126a788cad92010f7.zip | |
sl0p: grayscale idle panes too (neovim stayed in colour)
Reported: grayscale worked for most panes but not one running neovim.
Nothing to do with neovim specifically - it was the only pane sitting IDLE.
refresh_for_focus_change called render_full_viewport(), which marks the grid's
output BUFFER so the whole viewport is emitted rather than a diff. But
Pane::render() early-returns unless grid.should_render is set, and
render_full_viewport() does not set it. So an idle pane never re-rendered at
all and kept its previous colours indefinitely.
Shell panes hid the bug: they set should_render constantly on their own
(prompt redraws, cursor), so they picked up the change almost immediately and
looked correct. A pane parked in neovim with no output produced nothing, so it
never repainted.
Both calls are now made and the reason each is needed is documented at the
call site, because 'mark the buffer' and 'schedule a render' being two
separate flags is exactly the kind of thing that reads as redundant and gets
'cleaned up' later.
Baselines held: zellij-server 1436/30.
| -rw-r--r-- | zellij-server/src/panes/plugin_pane.rs | 9 | ||||
| -rw-r--r-- | zellij-server/src/panes/terminal_pane.rs | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/zellij-server/src/panes/plugin_pane.rs b/zellij-server/src/panes/plugin_pane.rs index 75a48ffc..8899e0a8 100644 --- a/zellij-server/src/panes/plugin_pane.rs +++ b/zellij-server/src/panes/plugin_pane.rs @@ -380,6 +380,15 @@ impl Pane for PluginPane { } fn refresh_for_focus_change(&mut self) { if self.style.inactive_pane_grayscale > 0 { + // BOTH calls are required, and it is not obvious why: + // render_full_viewport() marks the grid's output BUFFER so the + // whole viewport is emitted rather than just a diff, but + // render() early-returns unless should_render is set. + // Without the second call an IDLE pane never re-renders, so it keeps + // its previous colours indefinitely. Shell panes hid this because + // they set should_render constantly on their own; a pane sitting in + // neovim with no output did not, and stayed in colour. + self.set_should_render(true); self.render_full_viewport(); } } diff --git a/zellij-server/src/panes/terminal_pane.rs b/zellij-server/src/panes/terminal_pane.rs index 1b7c66d4..fa6005d0 100644 --- a/zellij-server/src/panes/terminal_pane.rs +++ b/zellij-server/src/panes/terminal_pane.rs @@ -474,6 +474,15 @@ impl Pane for TerminalPane { } fn refresh_for_focus_change(&mut self) { if self.style.inactive_pane_grayscale > 0 { + // BOTH calls are required, and it is not obvious why: + // render_full_viewport() marks the grid's output BUFFER so the + // whole viewport is emitted rather than just a diff, but + // render() early-returns unless should_render is set. + // Without the second call an IDLE pane never re-renders, so it keeps + // its previous colours indefinitely. Shell panes hid this because + // they set should_render constantly on their own; a pane sitting in + // neovim with no output did not, and stayed in colour. + self.set_should_render(true); self.render_full_viewport(); } } |
