From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626679910046497.7657971911542; Mon, 19 Jul 2021 00:31:50 -0700 (PDT) Received: from localhost ([::1]:43392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Nkj-0006WU-1J for importer@patchew.org; Mon, 19 Jul 2021 03:31:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NgT-0007pP-CY for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NgP-0001AK-Mf for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:25 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-80-M-5iqq4JMZOI7gYWhlnhbw-1; Mon, 19 Jul 2021 03:27:18 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 365D0804300 for ; Mon, 19 Jul 2021 07:27:18 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADE3F10016F5; Mon, 19 Jul 2021 07:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XYrfKnai1QVuD5mXiMbty+Pcn7ah5CGPp3cBp/runuo=; b=S6XUV4wmvjH4O1c9FPKpZqPkGeb8Zy/uudwVtPRTmonqnyA73NlAQ8pvJZ2GUkas2e3FSA 9rB4qc3kGzU1INwG8hy/t1Y9hA/ZMs4JN8Z2Wmpn4O5aEhKQJD3Ngm1Ts7vGZoFroYJs68 jS3ddtS0nAWbkiCdxVaQinF6C029Z7Y= X-MC-Unique: M-5iqq4JMZOI7gYWhlnhbw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 01/12] ui/vdagent: fix leak on error path Date: Mon, 19 Jul 2021 11:26:43 +0400 Message-Id: <20210719072654.845901-2-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626679910434100001 From: Marc-Andr=C3=A9 Lureau info is leaked if more than 10 entries Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/clipboard.h | 2 ++ ui/vdagent.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ui/clipboard.h b/include/ui/clipboard.h index b45b984c9f..eb789a285a 100644 --- a/include/ui/clipboard.h +++ b/include/ui/clipboard.h @@ -190,4 +190,6 @@ void qemu_clipboard_set_data(QemuClipboardPeer *peer, const void *data, bool update); =20 +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QemuClipboardInfo, qemu_clipboard_info_unref) + #endif /* QEMU_CLIPBOARD_H */ diff --git a/ui/vdagent.c b/ui/vdagent.c index a253a8fe63..f6ef8d1993 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -438,7 +438,7 @@ static void vdagent_chr_recv_clipboard(VDAgentChardev *= vd, VDAgentMessage *msg) uint8_t s =3D VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD; uint32_t size =3D msg->size; void *data =3D msg->data; - QemuClipboardInfo *info; + g_autoptr(QemuClipboardInfo) info =3D NULL; QemuClipboardType type; =20 if (have_selection(vd)) { @@ -477,7 +477,6 @@ static void vdagent_chr_recv_clipboard(VDAgentChardev *= vd, VDAgentMessage *msg) size -=3D sizeof(uint32_t); } qemu_clipboard_update(info); - qemu_clipboard_info_unref(info); break; case VD_AGENT_CLIPBOARD_REQUEST: if (size < sizeof(uint32_t)) { @@ -523,7 +522,6 @@ static void vdagent_chr_recv_clipboard(VDAgentChardev *= vd, VDAgentMessage *msg) /* set empty clipboard info */ info =3D qemu_clipboard_info_new(NULL, s); qemu_clipboard_update(info); - qemu_clipboard_info_unref(info); } break; } --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626679762741962.8051927446037; Mon, 19 Jul 2021 00:29:22 -0700 (PDT) Received: from localhost ([::1]:35472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5NiL-00017L-7C for importer@patchew.org; Mon, 19 Jul 2021 03:29:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nge-0007rk-OP for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34065) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ngb-0001HY-2d for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-520-16n6C60DN5C1_fWQa2d4Xg-1; Mon, 19 Jul 2021 03:27:30 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27B02100C610 for ; Mon, 19 Jul 2021 07:27:30 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B290620DE; Mon, 19 Jul 2021 07:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mx8jYSAcWVRFFAJpXewPtch97JOy/w7Yy8S8zCtuwMA=; b=UsPQA0WozIsu0ilm5nPRWlaQaty/0+9jpWYkPbu05HvrrDDa9vLSVSHxoGZxTfSym1/zUP WcABP4iuaiZuVdnqgDrdFWJ/VwnVrWJXCFxAuvsC+nHOLaRcbyVkUpHewzEXRd/rIiaOB0 yqeLa8caRf8Lkm072bAcyuRLYiakOOY= X-MC-Unique: 16n6C60DN5C1_fWQa2d4Xg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 02/12] ui/vdagent: remove copy-pasta comment Date: Mon, 19 Jul 2021 11:26:44 +0400 Message-Id: <20210719072654.845901-3-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626679763298100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index f6ef8d1993..5ae5734c81 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -516,7 +516,7 @@ static void vdagent_chr_recv_clipboard(VDAgentChardev *= vd, VDAgentMessage *msg) qemu_clipboard_set_data(&vd->cbpeer, vd->cbinfo[s], type, size, data, true); break; - case VD_AGENT_CLIPBOARD_RELEASE: /* data */ + case VD_AGENT_CLIPBOARD_RELEASE: if (vd->cbinfo[s] && vd->cbinfo[s]->owner =3D=3D &vd->cbpeer) { /* set empty clipboard info */ --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162668001462948.47221600363321; Mon, 19 Jul 2021 00:33:34 -0700 (PDT) Received: from localhost ([::1]:51898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5NmP-0003lI-Jd for importer@patchew.org; Mon, 19 Jul 2021 03:33:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ngp-000852-Cv for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ngn-0001UZ-VR for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-eoUaC4xqMq2hiDsf32VuLQ-1; Mon, 19 Jul 2021 03:27:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F02C2CC625 for ; Mon, 19 Jul 2021 07:27:42 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD94860918; Mon, 19 Jul 2021 07:27:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mx0brYSsHzma4V1wWuNBs/0zjSqwvBBSSRbRBEc0nLA=; b=ESOl3dWRc+YTtYoCmzivt7vxnNQLIVc0sWeqyRHyqnV/noW9y9PjRsZSTC55iopdyhIkS9 4b8AikRjDbkQ7thGkxwjhOcXHcw1VyqmYyvFjHqJYFohJvr5riQbO4TlnjEHwbUqFfCpJT yEK57GQvWcaNyOdBaKncXGzP8lfzb9M= X-MC-Unique: eoUaC4xqMq2hiDsf32VuLQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 03/12] ui/gtk-clipboard: use existing macros Date: Mon, 19 Jul 2021 11:26:45 +0400 Message-Id: <20210719072654.845901-4-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626680015181100001 From: Marc-Andr=C3=A9 Lureau Rather than hardcoding strings Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/gtk-clipboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/gtk-clipboard.c b/ui/gtk-clipboard.c index bff28d2030..5e817ae55c 100644 --- a/ui/gtk-clipboard.c +++ b/ui/gtk-clipboard.c @@ -177,11 +177,11 @@ void gd_clipboard_init(GtkDisplayState *gd) qemu_clipboard_peer_register(&gd->cbpeer); =20 gd->gtkcb[QEMU_CLIPBOARD_SELECTION_CLIPBOARD] =3D - gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE)); + gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); gd->gtkcb[QEMU_CLIPBOARD_SELECTION_PRIMARY] =3D - gtk_clipboard_get(gdk_atom_intern("PRIMARY", FALSE)); + gtk_clipboard_get(GDK_SELECTION_PRIMARY); gd->gtkcb[QEMU_CLIPBOARD_SELECTION_SECONDARY] =3D - gtk_clipboard_get(gdk_atom_intern("SECONDARY", FALSE)); + gtk_clipboard_get(GDK_SELECTION_SECONDARY); =20 g_signal_connect(gd->gtkcb[QEMU_CLIPBOARD_SELECTION_CLIPBOARD], "owner-change", G_CALLBACK(gd_owner_change), gd); --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626680141684739.9629154763227; Mon, 19 Jul 2021 00:35:41 -0700 (PDT) Received: from localhost ([::1]:58250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5NoS-0007xf-FD for importer@patchew.org; Mon, 19 Jul 2021 03:35:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ngx-0008HB-O3 for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34812) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ngw-0001aZ-5q for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:27:55 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-416-o8Q8LA6WPoK4e-B1AcSqGA-1; Mon, 19 Jul 2021 03:27:48 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C763C1084F6B for ; Mon, 19 Jul 2021 07:27:47 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5C0E60916; Mon, 19 Jul 2021 07:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oWI7ipGid6vRZncqlkQ6yP8ngm2uoAwYScZaPWZX/Gs=; b=fs35oUFG69gtU7dnP43orYzTb+JpOj09BS/wqVKsFO5xkQvG26SA53bg6vqMZzTWT6hniR tkDO0sgCoTcrvCzC9MmdIqbxDD/re1rZ0Zv8WEGL+gRMuaorrgcTcT26kuvUJY4FQSu0el nHF/4CbXLd8Q+IOkVTusMnetWWPN+Hk= X-MC-Unique: o8Q8LA6WPoK4e-B1AcSqGA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 04/12] ui/gtk-clipboard: fix clipboard enum typo Date: Mon, 19 Jul 2021 11:26:46 +0400 Message-Id: <20210719072654.845901-5-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626680143588100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/gtk-clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/gtk-clipboard.c b/ui/gtk-clipboard.c index 5e817ae55c..2c78de9500 100644 --- a/ui/gtk-clipboard.c +++ b/ui/gtk-clipboard.c @@ -155,7 +155,7 @@ static void gd_owner_change(GtkClipboard *clipboard, =20 =20 switch (event->owner_change.reason) { - case GDK_SETTING_ACTION_NEW: + case GDK_OWNER_CHANGE_NEW_OWNER: info =3D qemu_clipboard_info_new(&gd->cbpeer, s); if (gtk_clipboard_wait_is_text_available(clipboard)) { info->types[QEMU_CLIPBOARD_TYPE_TEXT].available =3D true; --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626679804354974.763777799412; Mon, 19 Jul 2021 00:30:04 -0700 (PDT) Received: from localhost ([::1]:37770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Nj1-0002fT-9G for importer@patchew.org; Mon, 19 Jul 2021 03:30:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nh9-0000C5-2Y for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nh7-0001kR-K8 for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:06 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-216-qoO5LzGnMaqCTK0LdsCPvw-1; Mon, 19 Jul 2021 03:28:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A559A100C61C for ; Mon, 19 Jul 2021 07:27:59 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB504752AB; Mon, 19 Jul 2021 07:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LcCxN767Av8hnZZxCKt8rX/rq3GEin1zUeoiL3cH15Q=; b=Of5t4A2u/aoMUrumQcWoDzxKl5grtJOWkQekGZaaMN0DEsEmyiP4FTPeOyNM1QDhJ0dFDd 1rVSqpTOBapk6+fJDvVr2TXONUZy8nyyyTf4VJgo3PriDFjqC40ey26Vbi7EtxRlAcqRIL DIhemFPhGLKnyannczOJlJah75b95oU= X-MC-Unique: qoO5LzGnMaqCTK0LdsCPvw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 05/12] ui/clipboard: add helper to retrieve current clipboard Date: Mon, 19 Jul 2021 11:26:47 +0400 Message-Id: <20210719072654.845901-6-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626679805976100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/clipboard.h | 9 +++++++++ ui/clipboard.c | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/ui/clipboard.h b/include/ui/clipboard.h index eb789a285a..e9fcb15c66 100644 --- a/include/ui/clipboard.h +++ b/include/ui/clipboard.h @@ -109,6 +109,15 @@ void qemu_clipboard_peer_register(QemuClipboardPeer *p= eer); */ void qemu_clipboard_peer_unregister(QemuClipboardPeer *peer); =20 +/** + * qemu_clipboard_info + * + * @selection: clipboard selection. + * + * Return the current clipboard data & owner informations. + */ +QemuClipboardInfo *qemu_clipboard_info(QemuClipboardSelection selection); + /** * qemu_clipboard_info_new * diff --git a/ui/clipboard.c b/ui/clipboard.c index 3525b30178..56c14509fe 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -4,6 +4,8 @@ static NotifierList clipboard_notifiers =3D NOTIFIER_LIST_INITIALIZER(clipboard_notifiers); =20 +static QemuClipboardInfo *cbinfo[QEMU_CLIPBOARD_SELECTION__COUNT]; + void qemu_clipboard_peer_register(QemuClipboardPeer *peer) { notifier_list_add(&clipboard_notifiers, &peer->update); @@ -16,7 +18,20 @@ void qemu_clipboard_peer_unregister(QemuClipboardPeer *p= eer) =20 void qemu_clipboard_update(QemuClipboardInfo *info) { + g_autoptr(QemuClipboardInfo) old =3D NULL; + assert(info->selection < QEMU_CLIPBOARD_SELECTION__COUNT); + notifier_list_notify(&clipboard_notifiers, info); + + old =3D cbinfo[info->selection]; + cbinfo[info->selection] =3D qemu_clipboard_info_ref(info); +} + +QemuClipboardInfo *qemu_clipboard_info(QemuClipboardSelection selection) +{ + assert(selection < QEMU_CLIPBOARD_SELECTION__COUNT); + + return cbinfo[selection]; } =20 QemuClipboardInfo *qemu_clipboard_info_new(QemuClipboardPeer *owner, --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162667994762321.81645642488354; Mon, 19 Jul 2021 00:32:27 -0700 (PDT) Received: from localhost ([::1]:46368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5NlK-0008Uh-Gi for importer@patchew.org; Mon, 19 Jul 2021 03:32:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NhJ-0000ZR-VI for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NhI-0001uI-FD for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:17 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-229-0gNOfnjWOHiPwRY56J-Vzw-1; Mon, 19 Jul 2021 03:28:12 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2312800050 for ; Mon, 19 Jul 2021 07:28:11 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id A61F15D6A1; Mon, 19 Jul 2021 07:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dyAj/jGLa1dUp+FcXAmClOE/DH525boYanfUhAheq6c=; b=NHFKw+f8hJGTAiyORBThFApaEfrUld+jZDLeW9vRwTBGBTakryVj54uX3AjoyVXtANYcgA /mvj4YbsNtcduHaMOJO1twLTwaDVu23MU5rJR5qAnvnESliZET27/drV7Rppot9YyxXidQ lAtgmCZ2rudgi8jIYok7i/MYspoYd1Y= X-MC-Unique: 0gNOfnjWOHiPwRY56J-Vzw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 06/12] ui/clipboard: release owned grabs on unregister Date: Mon, 19 Jul 2021 11:26:48 +0400 Message-Id: <20210719072654.845901-7-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626679947989100003 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/clipboard.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/clipboard.c b/ui/clipboard.c index 56c14509fe..a9512f01a7 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -13,6 +13,15 @@ void qemu_clipboard_peer_register(QemuClipboardPeer *pee= r) =20 void qemu_clipboard_peer_unregister(QemuClipboardPeer *peer) { + int i; + + for (i =3D 0; i < QEMU_CLIPBOARD_SELECTION__COUNT; i++) { + if (cbinfo[i] && cbinfo[i]->owner =3D=3D peer) { + /* release owned grabs */ + g_autoptr(QemuClipboardInfo) info =3D qemu_clipboard_info_new(= NULL, i); + qemu_clipboard_update(info); + } + } notifier_remove(&peer->update); } =20 --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626679838429730.9647164339725; Mon, 19 Jul 2021 00:30:38 -0700 (PDT) Received: from localhost ([::1]:39624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5NjY-0003vV-Ri for importer@patchew.org; Mon, 19 Jul 2021 03:30:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nha-0001AY-4M for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NhX-00026b-AO for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:33 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-484-tu23A4cANUGb102Lds8Ukg-1; Mon, 19 Jul 2021 03:28:24 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A37341084F56 for ; Mon, 19 Jul 2021 07:28:23 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBA7C3B04; Mon, 19 Jul 2021 07:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fuyjGOiagi3No9AY/vtRA8sF5be2g7np6Cy3NuedAZ4=; b=edNTYO/WuI3KgfFnTnLXazrMNID9RHXE93oSJs0iolk/JU019ZPjLvBz7NvtkMQYf8BQFn v/QaSepGxtNePRu4wrX67m+Awol6HXE/RBVUnwfjeWabYc+ZxjoiWK/3F4Aa7w4iOGiv6C nnUjg+oAm+Coxg2ulWHSjaQFLtD5n+k= X-MC-Unique: tu23A4cANUGb102Lds8Ukg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 07/12] ui/vdagent: unregister clipboard peer on finalize Date: Mon, 19 Jul 2021 11:26:49 +0400 Message-Id: <20210719072654.845901-8-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626679839986100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/vdagent.c b/ui/vdagent.c index 5ae5734c81..bce9f44b7b 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -782,6 +782,7 @@ static void vdagent_chr_fini(Object *obj) VDAgentChardev *vd =3D QEMU_VDAGENT_CHARDEV(obj); =20 buffer_free(&vd->outbuf); + qemu_clipboard_peer_unregister(&vd->cbpeer); } =20 static const TypeInfo vdagent_chr_type_info =3D { --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626679977683439.13076001513355; Mon, 19 Jul 2021 00:32:57 -0700 (PDT) Received: from localhost ([::1]:48210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Nlo-0001I2-KY for importer@patchew.org; Mon, 19 Jul 2021 03:32:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nhg-0001FO-Uk for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nhf-0002Dl-9s for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:40 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-1G6eS3usNnuDC8sW3uERrA-1; Mon, 19 Jul 2021 03:28:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9C2CC19251AC for ; Mon, 19 Jul 2021 07:28:36 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 331FD5D9F0; Mon, 19 Jul 2021 07:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LtTkugYKfcPe1eLTR2RWwsHw3ND8453W+l6kRaHzz0M=; b=A7AKU/5a0u313D/nUtA1NS3arpWQaX9pZkcX5KVL9KL1i62jXpM/+cpQD7d91JtS49JtbG 59JYBlyKMGkygxRydT3/xuO/6zntx0P8tFZdpeNbnMGGJAl+oGzS7+8ZBSKwlAHwh8Yhek gKMoyciKWBkZQQuUfjeb95vGyz6xr84= X-MC-Unique: 1G6eS3usNnuDC8sW3uERrA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 08/12] ui/vdagent: split clipboard recv message handling Date: Mon, 19 Jul 2021 11:26:50 +0400 Message-Id: <20210719072654.845901-9-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626679977966100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 157 +++++++++++++++++++++++++++++---------------------- 1 file changed, 89 insertions(+), 68 deletions(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index bce9f44b7b..f716f2d8c3 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -433,13 +433,94 @@ static void vdagent_clipboard_request(QemuClipboardIn= fo *info, vdagent_send_msg(vd, msg); } =20 +static void vdagent_clipboard_recv_grab(VDAgentChardev *vd, uint8_t s, uin= t32_t size, void *data) +{ + g_autoptr(QemuClipboardInfo) info =3D NULL; + + trace_vdagent_cb_grab_selection(GET_NAME(sel_name, s)); + info =3D qemu_clipboard_info_new(&vd->cbpeer, s); + if (size > sizeof(uint32_t) * 10) { + /* + * spice has 6 types as of 2021. Limiting to 10 entries + * so we we have some wiggle room. + */ + return; + } + while (size >=3D sizeof(uint32_t)) { + trace_vdagent_cb_grab_type(GET_NAME(type_name, *(uint32_t *)data)); + switch (*(uint32_t *)data) { + case VD_AGENT_CLIPBOARD_UTF8_TEXT: + info->types[QEMU_CLIPBOARD_TYPE_TEXT].available =3D true; + break; + default: + break; + } + data +=3D sizeof(uint32_t); + size -=3D sizeof(uint32_t); + } + qemu_clipboard_update(info); +} + +static void vdagent_clipboard_recv_request(VDAgentChardev *vd, uint8_t s, = uint32_t size, void *data) +{ + QemuClipboardType type; + + if (size < sizeof(uint32_t)) { + return; + } + switch (*(uint32_t *)data) { + case VD_AGENT_CLIPBOARD_UTF8_TEXT: + type =3D QEMU_CLIPBOARD_TYPE_TEXT; + break; + default: + return; + } + if (vd->cbinfo[s] && vd->cbinfo[s]->types[type].available && + vd->cbinfo[s]->owner !=3D &vd->cbpeer) { + if (vd->cbinfo[s]->types[type].data) { + vdagent_send_clipboard_data(vd, vd->cbinfo[s], type); + } else { + vd->cbpending[s] |=3D (1 << type); + qemu_clipboard_request(vd->cbinfo[s], type); + } + } +} + +static void vdagent_clipboard_recv_data(VDAgentChardev *vd, uint8_t s, uin= t32_t size, void *data) +{ + QemuClipboardType type; + + if (size < sizeof(uint32_t)) { + return; + } + switch (*(uint32_t *)data) { + case VD_AGENT_CLIPBOARD_UTF8_TEXT: + type =3D QEMU_CLIPBOARD_TYPE_TEXT; + break; + default: + return; + } + data +=3D 4; + size -=3D 4; + qemu_clipboard_set_data(&vd->cbpeer, vd->cbinfo[s], type, size, data, = true); +} + +static void vdagent_clipboard_recv_release(VDAgentChardev *vd, uint8_t s) +{ + g_autoptr(QemuClipboardInfo) info =3D NULL; + + if (vd->cbinfo[s] && vd->cbinfo[s]->owner =3D=3D &vd->cbpeer) { + /* set empty clipboard info */ + info =3D qemu_clipboard_info_new(NULL, s); + qemu_clipboard_update(info); + } +} + static void vdagent_chr_recv_clipboard(VDAgentChardev *vd, VDAgentMessage = *msg) { uint8_t s =3D VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD; uint32_t size =3D msg->size; void *data =3D msg->data; - g_autoptr(QemuClipboardInfo) info =3D NULL; - QemuClipboardType type; =20 if (have_selection(vd)) { if (size < 4) { @@ -455,75 +536,15 @@ static void vdagent_chr_recv_clipboard(VDAgentChardev= *vd, VDAgentMessage *msg) =20 switch (msg->type) { case VD_AGENT_CLIPBOARD_GRAB: - trace_vdagent_cb_grab_selection(GET_NAME(sel_name, s)); - info =3D qemu_clipboard_info_new(&vd->cbpeer, s); - if (size > sizeof(uint32_t) * 10) { - /* - * spice has 6 types as of 2021. Limiting to 10 entries - * so we we have some wiggle room. - */ - return; - } - while (size >=3D sizeof(uint32_t)) { - trace_vdagent_cb_grab_type(GET_NAME(type_name, *(uint32_t *)da= ta)); - switch (*(uint32_t *)data) { - case VD_AGENT_CLIPBOARD_UTF8_TEXT: - info->types[QEMU_CLIPBOARD_TYPE_TEXT].available =3D true; - break; - default: - break; - } - data +=3D sizeof(uint32_t); - size -=3D sizeof(uint32_t); - } - qemu_clipboard_update(info); - break; + return vdagent_clipboard_recv_grab(vd, s, size, data); case VD_AGENT_CLIPBOARD_REQUEST: - if (size < sizeof(uint32_t)) { - return; - } - switch (*(uint32_t *)data) { - case VD_AGENT_CLIPBOARD_UTF8_TEXT: - type =3D QEMU_CLIPBOARD_TYPE_TEXT; - break; - default: - return; - } - if (vd->cbinfo[s] && - vd->cbinfo[s]->types[type].available && - vd->cbinfo[s]->owner !=3D &vd->cbpeer) { - if (vd->cbinfo[s]->types[type].data) { - vdagent_send_clipboard_data(vd, vd->cbinfo[s], type); - } else { - vd->cbpending[s] |=3D (1 << type); - qemu_clipboard_request(vd->cbinfo[s], type); - } - } - break; + return vdagent_clipboard_recv_request(vd, s, size, data); case VD_AGENT_CLIPBOARD: /* data */ - if (size < sizeof(uint32_t)) { - return; - } - switch (*(uint32_t *)data) { - case VD_AGENT_CLIPBOARD_UTF8_TEXT: - type =3D QEMU_CLIPBOARD_TYPE_TEXT; - break; - default: - return; - } - data +=3D 4; - size -=3D 4; - qemu_clipboard_set_data(&vd->cbpeer, vd->cbinfo[s], type, - size, data, true); - break; + return vdagent_clipboard_recv_data(vd, s, size, data); case VD_AGENT_CLIPBOARD_RELEASE: - if (vd->cbinfo[s] && - vd->cbinfo[s]->owner =3D=3D &vd->cbpeer) { - /* set empty clipboard info */ - info =3D qemu_clipboard_info_new(NULL, s); - qemu_clipboard_update(info); - } - break; + return vdagent_clipboard_recv_release(vd, s); + default: + g_assert_not_reached(); } } =20 --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162668007354440.97131426760279; Mon, 19 Jul 2021 00:34:33 -0700 (PDT) Received: from localhost ([::1]:55558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5NnM-0006Aj-CS for importer@patchew.org; Mon, 19 Jul 2021 03:34:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nhs-0001Vl-BT for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Nhp-0002Jp-GA for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:28:52 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564-0p0f8jYvPn-BMWR-YkzxTQ-1; Mon, 19 Jul 2021 03:28:44 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE3C61835ACD for ; Mon, 19 Jul 2021 07:28:43 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6B545DEFB; Mon, 19 Jul 2021 07:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v6QRjXDmQMZsjGXwsAfRvtkI/inIk6o/FIuNc1J+844=; b=QMAx5zpVDSXVk0wPhSmzfiJ5cTo76Vt9CrENkTjiSxf4csGdDRzemvPg/gKYPrJPPRTPUN /Xlm7I8sc48sAVwIw/FR2C5abISr1Xd2bbjmC2q9yw3VwetLH7hL2CRmQ7UwNh8YbwR130 ifc+X5NPKQCgwcc6uF1a3waYySDZ+yk= X-MC-Unique: 0p0f8jYvPn-BMWR-YkzxTQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 09/12] ui/vdagent: use qemu_clipboard_info helper Date: Mon, 19 Jul 2021 11:26:51 +0400 Message-Id: <20210719072654.845901-10-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626680075011100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index f716f2d8c3..65c9663e0d 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -47,7 +47,6 @@ struct VDAgentChardev { =20 /* clipboard */ QemuClipboardPeer cbpeer; - QemuClipboardInfo *cbinfo[QEMU_CLIPBOARD_SELECTION__COUNT]; uint32_t cbpending[QEMU_CLIPBOARD_SELECTION__COUNT]; }; typedef struct VDAgentChardev VDAgentChardev; @@ -384,9 +383,7 @@ static void vdagent_clipboard_notify(Notifier *notifier= , void *data) QemuClipboardType type; bool self_update =3D info->owner =3D=3D &vd->cbpeer; =20 - if (info !=3D vd->cbinfo[s]) { - qemu_clipboard_info_unref(vd->cbinfo[s]); - vd->cbinfo[s] =3D qemu_clipboard_info_ref(info); + if (info !=3D qemu_clipboard_info(s)) { vd->cbpending[s] =3D 0; if (!self_update) { vdagent_send_clipboard_grab(vd, info); @@ -464,6 +461,7 @@ static void vdagent_clipboard_recv_grab(VDAgentChardev = *vd, uint8_t s, uint32_t static void vdagent_clipboard_recv_request(VDAgentChardev *vd, uint8_t s, = uint32_t size, void *data) { QemuClipboardType type; + QemuClipboardInfo *info; =20 if (size < sizeof(uint32_t)) { return; @@ -475,13 +473,14 @@ static void vdagent_clipboard_recv_request(VDAgentCha= rdev *vd, uint8_t s, uint32 default: return; } - if (vd->cbinfo[s] && vd->cbinfo[s]->types[type].available && - vd->cbinfo[s]->owner !=3D &vd->cbpeer) { - if (vd->cbinfo[s]->types[type].data) { - vdagent_send_clipboard_data(vd, vd->cbinfo[s], type); + + info =3D qemu_clipboard_info(s); + if (info && info->types[type].available && info->owner !=3D &vd->cbpee= r) { + if (info->types[type].data) { + vdagent_send_clipboard_data(vd, info, type); } else { vd->cbpending[s] |=3D (1 << type); - qemu_clipboard_request(vd->cbinfo[s], type); + qemu_clipboard_request(info, type); } } } @@ -489,6 +488,7 @@ static void vdagent_clipboard_recv_request(VDAgentChard= ev *vd, uint8_t s, uint32 static void vdagent_clipboard_recv_data(VDAgentChardev *vd, uint8_t s, uin= t32_t size, void *data) { QemuClipboardType type; + QemuClipboardInfo *info; =20 if (size < sizeof(uint32_t)) { return; @@ -502,14 +502,20 @@ static void vdagent_clipboard_recv_data(VDAgentCharde= v *vd, uint8_t s, uint32_t } data +=3D 4; size -=3D 4; - qemu_clipboard_set_data(&vd->cbpeer, vd->cbinfo[s], type, size, data, = true); + + info =3D qemu_clipboard_info(s); + if (info->owner =3D=3D &vd->cbpeer) { + qemu_clipboard_set_data(&vd->cbpeer, info, type, size, data, true); + } } =20 static void vdagent_clipboard_recv_release(VDAgentChardev *vd, uint8_t s) { + QemuClipboardInfo *cur; g_autoptr(QemuClipboardInfo) info =3D NULL; =20 - if (vd->cbinfo[s] && vd->cbinfo[s]->owner =3D=3D &vd->cbpeer) { + cur =3D qemu_clipboard_info(s); + if (cur && cur->owner =3D=3D &vd->cbpeer) { /* set empty clipboard info */ info =3D qemu_clipboard_info_new(NULL, s); qemu_clipboard_update(info); --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626680220497329.8523565701305; Mon, 19 Jul 2021 00:37:00 -0700 (PDT) Received: from localhost ([::1]:35000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Npj-0002uJ-D6 for importer@patchew.org; Mon, 19 Jul 2021 03:36:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42418) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ni4-0001zP-Ne for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:29:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54449) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ni2-0002Ud-4u for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:29:03 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-ZiA3Q9kAPJyBTwQGDxxFpg-1; Mon, 19 Jul 2021 03:29:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4308A100C611 for ; Mon, 19 Jul 2021 07:28:59 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3594E5DA2D; Mon, 19 Jul 2021 07:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=naWthqVYz5yqMdJoDRS9BuxuLlOuNk3D01S56gQ8Pek=; b=WUQm4GkH3zK1IjDhAS4a6NZSKcNgtNUc0H5WdC768lcwLlngu4jkw8+1dnz4aiyKxbXPJX LtRBOY9yKatkv1KWyPJ8xbHK0sfuTpBG2JFClLQ09Swx2YVUdvwOMd4ZQAdxtnf0llNe5j isMvnoz8Lh8JLf5pUWHYu6w9zYKBb7c= X-MC-Unique: ZiA3Q9kAPJyBTwQGDxxFpg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 10/12] ui/gtk-clipboard: use qemu_clipboard_info helper Date: Mon, 19 Jul 2021 11:26:52 +0400 Message-Id: <20210719072654.845901-11-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626680222466100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/gtk.h | 1 - ui/gtk-clipboard.c | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 9516670ebc..60e9cdc39c 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -139,7 +139,6 @@ struct GtkDisplayState { bool external_pause_update; =20 QemuClipboardPeer cbpeer; - QemuClipboardInfo *cbinfo[QEMU_CLIPBOARD_SELECTION__COUNT]; uint32_t cbpending[QEMU_CLIPBOARD_SELECTION__COUNT]; GtkClipboard *gtkcb[QEMU_CLIPBOARD_SELECTION__COUNT]; bool cbowner[QEMU_CLIPBOARD_SELECTION__COUNT]; diff --git a/ui/gtk-clipboard.c b/ui/gtk-clipboard.c index 2c78de9500..4e4b3c52bb 100644 --- a/ui/gtk-clipboard.c +++ b/ui/gtk-clipboard.c @@ -45,24 +45,24 @@ static void gd_clipboard_get_data(GtkClipboard *cli= pboard, GtkDisplayState *gd =3D data; QemuClipboardSelection s =3D gd_find_selection(gd, clipboard); QemuClipboardType type =3D QEMU_CLIPBOARD_TYPE_TEXT; - QemuClipboardInfo *info =3D qemu_clipboard_info_ref(gd->cbinfo[s]); + g_autoptr(QemuClipboardInfo) info =3D NULL; + + info =3D qemu_clipboard_info_ref(qemu_clipboard_info(s)); =20 qemu_clipboard_request(info, type); - while (info =3D=3D gd->cbinfo[s] && + while (info =3D=3D qemu_clipboard_info(s) && info->types[type].available && info->types[type].data =3D=3D NULL) { main_loop_wait(false); } =20 - if (info =3D=3D gd->cbinfo[s] && gd->cbowner[s]) { + if (info =3D=3D qemu_clipboard_info(s) && gd->cbowner[s]) { gtk_selection_data_set_text(selection_data, info->types[type].data, info->types[type].size); } else { /* clipboard owner changed while waiting for the data */ } - - qemu_clipboard_info_unref(info); } =20 static void gd_clipboard_clear(GtkClipboard *clipboard, @@ -81,9 +81,7 @@ static void gd_clipboard_notify(Notifier *notifier, void = *data) QemuClipboardSelection s =3D info->selection; bool self_update =3D info->owner =3D=3D &gd->cbpeer; =20 - if (info !=3D gd->cbinfo[s]) { - qemu_clipboard_info_unref(gd->cbinfo[s]); - gd->cbinfo[s] =3D qemu_clipboard_info_ref(info); + if (info !=3D qemu_clipboard_info(s)) { gd->cbpending[s] =3D 0; if (!self_update) { GtkTargetList *list; --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626679946724597.2062738264184; Mon, 19 Jul 2021 00:32:26 -0700 (PDT) Received: from localhost ([::1]:46316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5NlJ-0008SI-Ls for importer@patchew.org; Mon, 19 Jul 2021 03:32:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NiG-0002Hp-PW for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:29:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NiF-0002ej-6g for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:29:16 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-_KVNI_H7NM2ZWa0tUI1diQ-1; Mon, 19 Jul 2021 03:29:12 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F00B9CC622 for ; Mon, 19 Jul 2021 07:29:11 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF3F210016F5; Mon, 19 Jul 2021 07:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bHmi4GFcpQ09u8onnRU4rz8jtX9N+S3HdWepdqiUBWc=; b=V4MOGxP7G+xpEZ70jj5mBUtKRX0WBHxWWiPlQpQ1mnR1c5c7yQxyeBSrKgGOwOhP4ZvcKH g511/5sNk6R1CeBnSixbB4/gIf1QFNFzkOjbgs1AQ2/JiZFL4rlDRtFiRZqLzpNU12qvKD pnhgRBB7kshScWIAbAsUczEsbN/RCKQ= X-MC-Unique: _KVNI_H7NM2ZWa0tUI1diQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 11/12] ui/vdagent: send release when no clipboard owner Date: Mon, 19 Jul 2021 11:26:53 +0400 Message-Id: <20210719072654.845901-12-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626679947908100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/vdagent.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/ui/vdagent.c b/ui/vdagent.c index 65c9663e0d..34e1c332ee 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -345,6 +345,24 @@ static void vdagent_send_clipboard_grab(VDAgentChardev= *vd, vdagent_send_msg(vd, msg); } =20 +static void vdagent_send_clipboard_release(VDAgentChardev *vd, + QemuClipboardInfo *info) +{ + g_autofree VDAgentMessage *msg =3D g_malloc0(sizeof(VDAgentMessage) + + sizeof(uint32_t)); + + if (have_selection(vd)) { + uint8_t *s =3D msg->data; + *s =3D info->selection; + msg->size +=3D sizeof(uint32_t); + } else if (info->selection !=3D QEMU_CLIPBOARD_SELECTION_CLIPBOARD) { + return; + } + + msg->type =3D VD_AGENT_CLIPBOARD_RELEASE; + vdagent_send_msg(vd, msg); +} + static void vdagent_send_clipboard_data(VDAgentChardev *vd, QemuClipboardInfo *info, QemuClipboardType type) @@ -386,7 +404,11 @@ static void vdagent_clipboard_notify(Notifier *notifie= r, void *data) if (info !=3D qemu_clipboard_info(s)) { vd->cbpending[s] =3D 0; if (!self_update) { - vdagent_send_clipboard_grab(vd, info); + if (info->owner) { + vdagent_send_clipboard_grab(vd, info); + } else { + vdagent_send_clipboard_release(vd, info); + } } return; } --=20 2.32.0.93.g670b81a890 From nobody Sat May 18 08:46:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626680053433658.0289730245776; Mon, 19 Jul 2021 00:34:13 -0700 (PDT) Received: from localhost ([::1]:54094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Nn2-0005Dc-CN for importer@patchew.org; Mon, 19 Jul 2021 03:34:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NiT-0002t2-Rw for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:29:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5NiS-0002oq-Bk for qemu-devel@nongnu.org; Mon, 19 Jul 2021 03:29:29 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-577-p1-6LxExMZKJuoOoB-vXIQ-1; Mon, 19 Jul 2021 03:29:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07B4D1835AC2 for ; Mon, 19 Jul 2021 07:29:24 +0000 (UTC) Received: from localhost (unknown [10.36.110.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80A925C22A; Mon, 19 Jul 2021 07:29:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626679767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F8+fiOj5htAxTq0Qfeidh0eq3B9OKyUc5EkQ6s2psyQ=; b=BV0mgrePhjn7vqAgk58qkUI7X3DhFm6ZvN0FVYhoP3v8Gc7eSEUFOvkiTNz3Yzq9RLhN60 +YDOXZb6v41HQ6dcYLbgMNajTAKuoot4VY1H4pkzuXWD5zLiT5gDNhH/pD12wlec50vRAr W6dOlHgB4FQOcj2BOHrs73p89oe5D1M= X-MC-Unique: p1-6LxExMZKJuoOoB-vXIQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 12/12] ui/gtk-clipboard: emit release clipboard events Date: Mon, 19 Jul 2021 11:26:54 +0400 Message-Id: <20210719072654.845901-13-marcandre.lureau@redhat.com> In-Reply-To: <20210719072654.845901-1-marcandre.lureau@redhat.com> References: <20210719072654.845901-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.466, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1626680055397100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/gtk-clipboard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/gtk-clipboard.c b/ui/gtk-clipboard.c index 4e4b3c52bb..16b2e2063e 100644 --- a/ui/gtk-clipboard.c +++ b/ui/gtk-clipboard.c @@ -144,7 +144,7 @@ static void gd_owner_change(GtkClipboard *clipboard, { GtkDisplayState *gd =3D data; QemuClipboardSelection s =3D gd_find_selection(gd, clipboard); - QemuClipboardInfo *info; + g_autoptr(QemuClipboardInfo) info =3D NULL; =20 if (gd->cbowner[s]) { /* ignore notifications about our own grabs */ @@ -158,13 +158,13 @@ static void gd_owner_change(GtkClipboard *clipboard, if (gtk_clipboard_wait_is_text_available(clipboard)) { info->types[QEMU_CLIPBOARD_TYPE_TEXT].available =3D true; } - - qemu_clipboard_update(info); - qemu_clipboard_info_unref(info); break; default: + info =3D qemu_clipboard_info_new(NULL, s); + gd->cbowner[s] =3D false; break; } + qemu_clipboard_update(info); } =20 void gd_clipboard_init(GtkDisplayState *gd) --=20 2.32.0.93.g670b81a890