From patchwork Thu Aug 17 14:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guoyi Tu X-Patchwork-Id: 1822394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RRS0m08sGz1yZd for ; Fri, 18 Aug 2023 00:23:35 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWdtg-0003u9-N4; Thu, 17 Aug 2023 10:22:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWdtd-0003so-8m for qemu-devel@nongnu.org; Thu, 17 Aug 2023 10:22:45 -0400 Received: from smtpnm6-06.21cn.com ([182.42.144.170] helo=chinatelecom.cn) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWdta-0004kG-HW for qemu-devel@nongnu.org; Thu, 17 Aug 2023 10:22:45 -0400 HMM_SOURCE_IP: 192.168.138.117:19873.1524632281 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-182.148.58.152 (unknown [192.168.138.117]) by chinatelecom.cn (HERMES) with SMTP id DC155E821C; Thu, 17 Aug 2023 22:13:58 +0800 (CST) X-189-SAVE-TO-SEND: +tugy@chinatelecom.cn Received: from ([182.148.58.152]) by gateway-ssl-dep-56d86dc765-7s8sf with ESMTP id 1fe151063b5842989e06f5ba66ba1b57 for kraxel@redhat.com; Thu, 17 Aug 2023 22:14:00 CST X-Transaction-ID: 1fe151063b5842989e06f5ba66ba1b57 X-Real-From: tugy@chinatelecom.cn X-Receive-IP: 182.148.58.152 X-MEDUSA-Status: 0 From: tugy@chinatelecom.cn To: kraxel@redhat.com, marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org, tugy@chinatelecom.cn, dengpc12@chinatelecom.cn Subject: [PATCH v1 1/2] ui/vdagent: call vdagent_disconnect() when agent connection is lost Date: Thu, 17 Aug 2023 22:12:52 +0800 Message-Id: <71fd5a58fd09f10cdb35f167b2edb5669300116e.1692281173.git.tugy@chinatelecom.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=182.42.144.170; envelope-from=tugy@chinatelecom.cn; helo=chinatelecom.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Guoyi Tu 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 Signed-off-by: dengpengcheng Reviewed-by: Marc-André Lureau --- ui/vdagent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index 8a651492f0..4b9a1fb7c5 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);