diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-10-26 23:25:13 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-10-26 23:25:13 +0800 |
| commit | bdefdb301db843e87aee8c6c35808d295bb66ee5 (patch) | |
| tree | 7a1658ca487b8eabe9517d4cfd8ace6d5b499f85 /ricochet/src/tui/screen.cc | |
| parent | e138e537bfb18a48391a973723940eec544dd8e1 (diff) | |
| download | rcc-project-bdefdb301db843e87aee8c6c35808d295bb66ee5.tar.gz rcc-project-bdefdb301db843e87aee8c6c35808d295bb66ee5.tar.xz | |
feat(tui): integrate address input and navigation requests
Diffstat (limited to 'ricochet/src/tui/screen.cc')
| -rw-r--r-- | ricochet/src/tui/screen.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ricochet/src/tui/screen.cc b/ricochet/src/tui/screen.cc index 99d4e36..2bb9c85 100644 --- a/ricochet/src/tui/screen.cc +++ b/ricochet/src/tui/screen.cc @@ -513,7 +513,7 @@ public: return std::nullopt; } - void draw( const Frame& frame ) const + void draw( const Frame& frame, bool redraw ) const { const auto dimensions = size(); if ( werase( stdscr ) == ERR ) { @@ -550,7 +550,12 @@ public: } else { curs_set( 0 ); } - if ( wnoutrefresh( stdscr ) == ERR || doupdate() == ERR ) { + // An explicit Ctrl+L repairs the physical screen, not just our virtual frame. + // clearok is consumed by wrefresh; ordinary frames retain batched updates. + if ( redraw ) { + clearok( stdscr, TRUE ); + } + if ( redraw ? wrefresh( stdscr ) == ERR : ( wnoutrefresh( stdscr ) == ERR || doupdate() == ERR ) ) { throw std::runtime_error( "ncurses screen refresh failed" ); } } @@ -590,7 +595,7 @@ InputBatch Screen::read_events( std::size_t limit ) std::optional<TerminalClosed> Screen::wait( int wake_fd, std::chrono::milliseconds max_wait ) { return impl_->wait( wake_fd, max_wait ); } -void Screen::draw( const Frame& frame ) -{ impl_->draw( frame ); } +void Screen::draw( const Frame& frame, bool redraw ) +{ impl_->draw( frame, redraw ); } } // namespace ricochet::tui::detail |
