提交 63658280 编写于 作者: G Gerd Hoffmann

vnc update fix

We need to remember has_updates for each vnc client.  Otherwise it might
happen that vnc_update_client(has_dirty=1) takes the first exit due to
output buffers not being flushed yet and subsequent calls with
has_dirty=0 take the second exit, wrongly assuming there is nothing to
do because the work defered in the first call is ignored.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: NPeter Lieven <pl@kamp.de>
上级 07535a89
...@@ -887,6 +887,7 @@ static int find_and_clear_dirty_height(struct VncState *vs, ...@@ -887,6 +887,7 @@ static int find_and_clear_dirty_height(struct VncState *vs,
static int vnc_update_client(VncState *vs, int has_dirty, bool sync) static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
{ {
vs->has_dirty += has_dirty;
if (vs->need_update && vs->csock != -1) { if (vs->need_update && vs->csock != -1) {
VncDisplay *vd = vs->vd; VncDisplay *vd = vs->vd;
VncJob *job; VncJob *job;
...@@ -898,7 +899,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) ...@@ -898,7 +899,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
/* kernel send buffers are full -> drop frames to throttle */ /* kernel send buffers are full -> drop frames to throttle */
return 0; return 0;
if (!has_dirty && !vs->audio_cap && !vs->force_update) if (!vs->has_dirty && !vs->audio_cap && !vs->force_update)
return 0; return 0;
/* /*
...@@ -941,6 +942,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync) ...@@ -941,6 +942,7 @@ static int vnc_update_client(VncState *vs, int has_dirty, bool sync)
vnc_jobs_join(vs); vnc_jobs_join(vs);
} }
vs->force_update = 0; vs->force_update = 0;
vs->has_dirty = 0;
return n; return n;
} }
......
...@@ -263,6 +263,7 @@ struct VncState ...@@ -263,6 +263,7 @@ struct VncState
VncDisplay *vd; VncDisplay *vd;
int need_update; int need_update;
int force_update; int force_update;
int has_dirty;
uint32_t features; uint32_t features;
int absolute; int absolute;
int last_x; int last_x;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册