From 1bee9a2121fc458b0dfcef7245be907a83b3dec6 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 4 Nov 2018 05:55:35 +0000 Subject: [PATCH] don't recycle the video context unnecessarily git-svn-id: https://xpra.org/svn/Xpra/trunk@20926 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/server/window/window_video_source.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/xpra/server/window/window_video_source.py b/src/xpra/server/window/window_video_source.py index 3f254d9e7a..914437e063 100644 --- a/src/xpra/server/window/window_video_source.py +++ b/src/xpra/server/window/window_video_source.py @@ -987,8 +987,18 @@ def update_encoding_options(self, force_reload=False): ww, wh = self.window_dimensions vs.identify_video_subregion(ww, wh, self.statistics.damage_events_count, self.statistics.last_damage_events, self.statistics.last_resized) newrect = vs.rectangle - if newrect is None or old is None or newrect!=old: - self.cleanup_codecs() + if ((newrect is None) ^ (old is None)) or newrect!=old: + if old is None and newrect and newrect.get_geometry()==(0, 0, ww, wh): + #not actually changed! + #the region is the whole window + pass + elif newrect is None and old and old.get_geometry()==(0, 0, ww, wh): + #not actually changed! + #the region is the whole window + pass + else: + videolog("video subregion was %s, now %s (window size: %i,%i)", old, newrect, ww, wh) + self.cleanup_codecs() if newrect: #remove this from regular refresh: if old is None or old!=newrect: