summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-21 03:32:07 +0200
committersalmonik <salmonik@tuta.io>2026-08-21 03:32:07 +0200
commit956093be4f3b7a0fe86a523e5f9d9e74b9a77e59 (patch)
tree7dd442e399a8b7cc40de6acc79f78d1e70a641d0
parentv0.5.11: fix terminal focus — toggle ACTIVE on Focus messages (diff)
downloadrs-dos-956093be4f3b7a0fe86a523e5f9d9e74b9a77e59.tar.gz
rs-dos-956093be4f3b7a0fe86a523e5f9d9e74b9a77e59.zip
wm: flush terminal window content on gaining focus
focus() only composites the title bar — the window content stays stale until the next write. Call term.flush() on Focus(true) so the full window is re-composited immediately when switching to it.
-rw-r--r--rsnix/src/tty.rs3
-rw-r--r--rsnix/src/vt.rs2
2 files changed, 4 insertions, 1 deletions
diff --git a/rsnix/src/tty.rs b/rsnix/src/tty.rs
index c44dca8..ad33cb3 100644
--- a/rsnix/src/tty.rs
+++ b/rsnix/src/tty.rs
@@ -201,6 +201,9 @@ pub fn read_line_from_queue(term: &mut crate::vt::Terminal) -> Option<LineInput>
201 crate::sched::TaskMsg::Focus(gained) => { 201 crate::sched::TaskMsg::Focus(gained) => {
202 if gained { 202 if gained {
203 crate::vt::set_active(term as *mut crate::vt::Terminal); 203 crate::vt::set_active(term as *mut crate::vt::Terminal);
204 // Re-composite the full window so content is visible
205 // immediately (focus() only redraws the title bar).
206 term.flush();
204 } else { 207 } else {
205 crate::vt::set_active(core::ptr::null_mut()); 208 crate::vt::set_active(core::ptr::null_mut());
206 } 209 }
diff --git a/rsnix/src/vt.rs b/rsnix/src/vt.rs
index 0d7cf9b..d02cefa 100644
--- a/rsnix/src/vt.rs
+++ b/rsnix/src/vt.rs
@@ -552,7 +552,7 @@ impl Terminal {
552 } 552 }
553 } 553 }
554 554
555 fn flush(&mut self) { 555 pub fn flush(&mut self) {
556 if self.pending_scrolls > 0 { 556 if self.pending_scrolls > 0 {
557 return; 557 return;
558 } 558 }