diff options
Diffstat (limited to 'src/client/mod.rs')
| -rw-r--r-- | src/client/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs index f95d0fd4..5b6c1bf1 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -42,6 +42,9 @@ use crate::server::protocol::{ struct ClientState { /// The last frame we rendered, used for diff-based blitting. last_frame: Option<FrameData>, + /// Last visible cursor exported by the focused pane, used as the hidden + /// cursor parking position when the pane temporarily hides its cursor. + last_visible_cursor: Option<(u16, u16)>, /// The terminal size we reported to the server in our last Hello/Resize. reported_size: (u16, u16), /// Client-local sound playback config, refreshed on server request. @@ -359,6 +362,7 @@ async fn run_client_loop( ) -> Result<(), ClientError> { let mut state = ClientState { last_frame: None, + last_visible_cursor: None, reported_size: (cols, rows), sound_config, }; @@ -424,7 +428,11 @@ async fn run_client_loop( } ClientLoopEvent::ServerMessage(msg) => match msg { ServerMessage::Frame(frame_data) => { - blit::blit_frame(&frame_data, state.last_frame.as_ref()); + blit::blit_frame_with_cursor_memory( + &frame_data, + state.last_frame.as_ref(), + &mut state.last_visible_cursor, + ); state.last_frame = Some(frame_data); let _ = io::stdout().flush(); } |
