From cca925e0207160475bd670ae855235eab4cfdf40 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Mon, 16 Apr 2012 03:06:11 -0400 Subject: [PATCH] Reset prediction engine after size has changed (i.e. after Resize is applied) --- src/frontend/terminaloverlay.cc | 7 +++++++ src/frontend/terminaloverlay.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/frontend/terminaloverlay.cc b/src/frontend/terminaloverlay.cc index 1f83924b9..06cce3b7b 100644 --- a/src/frontend/terminaloverlay.cc +++ b/src/frontend/terminaloverlay.cc @@ -388,6 +388,13 @@ void PredictionEngine::cull( const Framebuffer &fb ) return; } + if ( (last_height != fb.ds.get_height()) + || (last_width != fb.ds.get_width()) ) { + last_height = fb.ds.get_height(); + last_width = fb.ds.get_width(); + reset(); + } + uint64_t now = timestamp(); /* control srtt_trigger with hysteresis */ diff --git a/src/frontend/terminaloverlay.h b/src/frontend/terminaloverlay.h index a0880a68c..d4bde26a9 100644 --- a/src/frontend/terminaloverlay.h +++ b/src/frontend/terminaloverlay.h @@ -191,6 +191,8 @@ namespace Overlay { unsigned int send_interval; + int last_height, last_width; + public: enum DisplayPreference { Always, @@ -227,6 +229,7 @@ namespace Overlay { glitch_trigger( 0 ), last_quick_confirmation( 0 ), send_interval( 250 ), + last_height( 0 ), last_width( 0 ), display_preference( Adaptive ) { }