aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorGuoyi Tu <tugy@chinatelecom.cn>2023-08-17 22:12:52 +0800
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-09-04 15:29:07 +0400
commit1b4fd51656556646b1a0842e596cb606d73e26cf (patch)
tree17139f088123fc69f5342915bdbfd3a76302ada1 /ui
parent7007e98c4ba443ce5d42acf851daaa1835b18e83 (diff)
downloadqemu-1b4fd51656556646b1a0842e596cb606d73e26cf.zip
qemu-1b4fd51656556646b1a0842e596cb606d73e26cf.tar.gz
qemu-1b4fd51656556646b1a0842e596cb606d73e26cf.tar.bz2
ui/vdagent: call vdagent_disconnect() when agent connection is lost
when the agent connection is lost, the input handler of the mouse doesn't deactivate, which results in unresponsive mouse events in VNC windows. To fix this issue, call vdagent_disconnect() to reset the state each time the frontend disconncect Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn> Signed-off-by: dengpengcheng <dengpc12@chinatelecom.cn> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <71fd5a58fd09f10cdb35f167b2edb5669300116e.1692281173.git.tugy@chinatelecom.cn>
Diffstat (limited to 'ui')
-rw-r--r--ui/vdagent.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/vdagent.c b/ui/vdagent.c
index 8a65149..4b9a1fb 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -870,8 +870,11 @@ static void vdagent_disconnect(VDAgentChardev *vd)
static void vdagent_chr_set_fe_open(struct Chardev *chr, int fe_open)
{
+ VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(chr);
+
if (!fe_open) {
trace_vdagent_close();
+ vdagent_disconnect(vd);
/* To reset_serial, we CLOSED our side. Make sure the other end knows we
* are ready again. */
qemu_chr_be_event(chr, CHR_EVENT_OPENED);