aboutsummaryrefslogtreecommitdiff
path: root/src/tui/screen.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-10-26 23:25:13 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-10-26 23:25:13 +0800
commit079eacb0f80b7b0d13b35544c382ac50fee9076d (patch)
tree272a50872348d0c60a9a794083ea8a2182676a0b /src/tui/screen.cc
parent9bfcdbf2131ae6c08040226be6e92447db625b18 (diff)
downloadrwebbrowser-master.tar.gz
rwebbrowser-master.tar.xz
feat(tui): integrate address input and navigation requestsHEADmaster
Diffstat (limited to 'src/tui/screen.cc')
-rw-r--r--src/tui/screen.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tui/screen.cc b/src/tui/screen.cc
index 99d4e36..2bb9c85 100644
--- a/src/tui/screen.cc
+++ b/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