From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077944; cv=none; d=zohomail.com; s=zohoarc; b=Oa/2NXFwv+RRQbeHX8mezxf6PSJAwMzAQ2Y7cyCa2G8ob63vCHkYPU1DPq2YGgKCsIrkrBeKoOdvc9MJHazhKw7WKn+DR/xUhRWLP+rn2/wbzqQ2an6PfxgiznkFcv/pgz2AJKXQXjh9wb3Hosb5R9bLh1icMQbZejY+gg7nwrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077944; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tw2K9JhMxJEb5gwCYrrPtpeAU7EAE0x2nXmzZQ7oltA=; b=ZI+p9iitR9+eGGW7OqwQv/5mRUfbsGK+xbByOwJiQbgcKwutRdVEb5WEeSZbfxfEdmMKaH4/dNU11gbgDu6nb6lMtT8W3xxlmp1a82ESnnqQBNM7gnLj8FSora6o/1WjhNS5KstEnt/+F8lSNsyTK0Ukyx1jjB45um/vPewRYno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077944295307.80866801308764; Mon, 30 Jan 2023 03:25:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSHI-0006Oz-PY; Mon, 30 Jan 2023 06:24:48 -0500 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 1pMSHD-0006OJ-QR for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHC-00080L-Dn for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:43 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-121-BVK3Lf4ROtS75wtkUL_uSw-1; Mon, 30 Jan 2023 06:24:39 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1BB8618E0A61 for ; Mon, 30 Jan 2023 11:24:39 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 542DD492B01; Mon, 30 Jan 2023 11:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077881; 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=tw2K9JhMxJEb5gwCYrrPtpeAU7EAE0x2nXmzZQ7oltA=; b=GG80lK+99iY+/MAkkuvyil9nhirOOhhP+MjoCawXRhSShO+3kzpWocPHN13l1TK4tmInWg CxoUcUqYS6kpjq7JlyDmG4m7YfxtJpobMvM1lwJtjqWwZsPPPXp7o596YanoePLa+4iDD1 hsKy1i6+ddCpBQEBuhwDzs9h77/Mgoc= X-MC-Unique: BVK3Lf4ROtS75wtkUL_uSw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 01/11] ui/dbus: unregister clipboard on connection close Date: Mon, 30 Jan 2023 15:24:21 +0400 Message-Id: <20230130112431.69559-2-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077944828100001 From: Marc-Andr=C3=A9 Lureau Fixes unregistration with p2p connections, since they don't have an associated name owner. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/dbus-clipboard.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ui/dbus-clipboard.c b/ui/dbus-clipboard.c index 5843d26cd2..d78f9db18f 100644 --- a/ui/dbus-clipboard.c +++ b/ui/dbus-clipboard.c @@ -203,15 +203,6 @@ dbus_clipboard_unregister_proxy(DBusDisplay *dpy) g_clear_object(&dpy->clipboard_proxy); } =20 -static void -dbus_on_clipboard_proxy_name_owner_changed( - DBusDisplay *dpy, - GObject *object, - GParamSpec *pspec) -{ - dbus_clipboard_unregister_proxy(dpy); -} - static gboolean dbus_clipboard_register( DBusDisplay *dpy, @@ -219,6 +210,7 @@ dbus_clipboard_register( { g_autoptr(GError) err =3D NULL; const char *name =3D NULL; + GDBusConnection *connection =3D g_dbus_method_invocation_get_connectio= n(invocation); =20 if (dpy->clipboard_proxy) { g_dbus_method_invocation_return_error( @@ -231,7 +223,7 @@ dbus_clipboard_register( =20 dpy->clipboard_proxy =3D qemu_dbus_display1_clipboard_proxy_new_sync( - g_dbus_method_invocation_get_connection(invocation), + connection, G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, g_dbus_method_invocation_get_sender(invocation), "/org/qemu/Display1/Clipboard", @@ -251,7 +243,11 @@ dbus_clipboard_register( =20 g_object_connect(dpy->clipboard_proxy, "swapped-signal::notify::g-name-owner", - dbus_on_clipboard_proxy_name_owner_changed, dpy, + dbus_clipboard_unregister_proxy, dpy, + NULL); + g_object_connect(connection, + "swapped-signal::closed", + dbus_clipboard_unregister_proxy, dpy, NULL); qemu_clipboard_reset_serial(); =20 --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077934; cv=none; d=zohomail.com; s=zohoarc; b=H3Dd4dMTF9s3dd540EQ79I3Jik3KCYZLHPG4wOrme8r6PxOe9ai1on9iVBtndbiSwffbK0XefVDDCVsT8mnrgG5CcaEf7JqRpAAChsxb6cwt0iwB1P4Vybcgp0XhpiqAhLD0yZtG9LdI0XRZEHCnetN0Rg+Ai64nT1L+BIOLDb0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077934; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=n3yakMaGzi10bZGUDN5PeadOuVselyQ0juNRj+nmoQQ=; b=b+/WyyusNZZMZ5RjpE6gMLMVDmf1ZaTJhng/3AQ4goHorYw588beEx5sAflOh67BIzvxktICegGEIKzmHyC4H1pxAjKRteOxmfKDpzm4tb7SC1mpSikyWCI2LyHi2D9/8tYuY6FdBO8AseljU8sdInDqySm2/rXqRINWIu2mFLk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077934653980.9989428309952; Mon, 30 Jan 2023 03:25:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSHM-0006QK-TM; Mon, 30 Jan 2023 06:24:53 -0500 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 1pMSHL-0006Pe-3x for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHI-00080s-1R for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:50 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-436-elmvhoJPOsKLo5tmgrQ72g-1; Mon, 30 Jan 2023 06:24:44 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01F0487AA19 for ; Mon, 30 Jan 2023 11:24:43 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39448C15BAE; Mon, 30 Jan 2023 11:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077886; 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=n3yakMaGzi10bZGUDN5PeadOuVselyQ0juNRj+nmoQQ=; b=OWFW4u209VpCnE72bRqlQB1IZlDCyEAIuV4B07FOwiGN+NUcLYw/vy7zCQj1EiRO7BKyO5 GVVCLYTaHi42NPX1FAoau7ihdopXb7YohVgoFGT5TIvNTUEDPAUopoCnWF6FtiebCfoSAw nzTBn6UaJBDmlq5EPKLAkTL0dgwe54k= X-MC-Unique: elmvhoJPOsKLo5tmgrQ72g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 02/11] audio/dbus: there are no sender for p2p mode Date: Mon, 30 Jan 2023 15:24:22 +0400 Message-Id: <20230130112431.69559-3-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077936790100013 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- audio/audio_int.h | 2 +- audio/dbusaudio.c | 6 ++++-- ui/dbus.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index e87ce014a0..38864bfbbd 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -145,7 +145,7 @@ struct audio_driver { void *(*init) (Audiodev *); void (*fini) (void *); #ifdef CONFIG_GIO - void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *mana= ger); + void (*set_dbus_server) (AudioState *s, GDBusObjectManagerServer *mana= ger, bool p2p); #endif struct audio_pcm_ops *pcm_ops; int can_be_default; diff --git a/audio/dbusaudio.c b/audio/dbusaudio.c index 722df0355e..9032dda49c 100644 --- a/audio/dbusaudio.c +++ b/audio/dbusaudio.c @@ -43,6 +43,7 @@ =20 typedef struct DBusAudio { GDBusObjectManagerServer *server; + bool p2p; GDBusObjectSkeleton *audio; QemuDBusDisplay1Audio *iface; GHashTable *out_listeners; @@ -448,7 +449,7 @@ dbus_audio_register_listener(AudioState *s, bool out) { DBusAudio *da =3D s->drv_opaque; - const char *sender =3D g_dbus_method_invocation_get_sender(invocation); + const char *sender =3D da->p2p ? "p2p" : g_dbus_method_invocation_get_= sender(invocation); g_autoptr(GDBusConnection) listener_conn =3D NULL; g_autoptr(GError) err =3D NULL; g_autoptr(GSocket) socket =3D NULL; @@ -591,7 +592,7 @@ dbus_audio_register_in_listener(AudioState *s, } =20 static void -dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server) +dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server, boo= l p2p) { DBusAudio *da =3D s->drv_opaque; =20 @@ -599,6 +600,7 @@ dbus_audio_set_server(AudioState *s, GDBusObjectManager= Server *server) g_assert(!da->server); =20 da->server =3D g_object_ref(server); + da->p2p =3D p2p; =20 da->audio =3D g_dbus_object_skeleton_new(DBUS_DISPLAY1_AUDIO_PATH); da->iface =3D qemu_dbus_display1_audio_skeleton_new(); diff --git a/ui/dbus.c b/ui/dbus.c index 32d88dc94a..0a9e2f4611 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -219,7 +219,7 @@ dbus_display_complete(UserCreatable *uc, Error **errp) dd->audiodev); return; } - audio_state->drv->set_dbus_server(audio_state, dd->server); + audio_state->drv->set_dbus_server(audio_state, dd->server, dd->p2p= ); } =20 consoles =3D g_array_new(FALSE, FALSE, sizeof(guint32)); --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077932; cv=none; d=zohomail.com; s=zohoarc; b=m9t2/aDDCPMrbPe0TvebY87TTmTu/Gdb0dMQCvx1OQQOtJquMCoZ8xE87lgqp8RHt49o5QvCrwvJMHkdXw+4VoyUkta+KvJ5ybByjCXAbhpTPyNn1ROg4FHoxypN/iYZwwjcrBF3EyUm6uMi/ZQ3mPzxMxjJXyNymK+qgBgL9SI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077932; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tq9A6kvWcG3qXORH7zjW3800S+CMJJCRNZgtOxmrjMI=; b=jG2fRUoNfC4KhWw6EzL7/5kIh54tbOH7VfSKQ11bRC71LAaaUbc0QD44KVy2XjpJg6uBtwZXnSCB32qlT1pI4LdsBch3sBEz+D6N5hxq697N/ujPpxeYl5k0GkuPb46dsKfsTYs0ELUK9mpZ+8ghUVQK8cquwOXxxEiQMS8AKAo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077932969195.96189535017993; Mon, 30 Jan 2023 03:25:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSHO-0006Qi-I8; Mon, 30 Jan 2023 06:24:54 -0500 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 1pMSHM-0006Q3-Ix for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHK-00081I-Mt for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:52 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-VEgXW4lgMqCVf6twsrOcvg-1; Mon, 30 Jan 2023 06:24:48 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B7D3E1C3A078 for ; Mon, 30 Jan 2023 11:24:46 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD4A91121314; Mon, 30 Jan 2023 11:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077890; 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=tq9A6kvWcG3qXORH7zjW3800S+CMJJCRNZgtOxmrjMI=; b=cADuWlofuxtTQ09YPRv1qyg3+WhqoZRZvp3412gb7GSpfNgHVAw8x8wYjlq47anl7f75Hh UDz6AAy9B+7DEmRloHzGUYl8//M14PcdW+jNB66DvcfGAiHpnBbdQY+FZhNTqcrA7jsAlw e4kHZMIg12EUznmFi2L0SFru88JQnlU= X-MC-Unique: VEgXW4lgMqCVf6twsrOcvg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 03/11] ui/dbus: set mouse is-absolute during console creation Date: Mon, 30 Jan 2023 15:24:23 +0400 Message-Id: <20230130112431.69559-4-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077935708100011 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/dbus-console.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/dbus-console.c b/ui/dbus-console.c index 898a4ac8a5..241797b7e9 100644 --- a/ui/dbus-console.c +++ b/ui/dbus-console.c @@ -410,15 +410,21 @@ dbus_mouse_release(DBusDisplayConsole *ddc, return DBUS_METHOD_INVOCATION_HANDLED; } =20 +static void +dbus_mouse_update_is_absolute(DBusDisplayConsole *ddc) +{ + g_object_set(ddc->iface_mouse, + "is-absolute", qemu_input_is_absolute(), + NULL); +} + static void dbus_mouse_mode_change(Notifier *notify, void *data) { DBusDisplayConsole *ddc =3D container_of(notify, DBusDisplayConsole, mouse_mode_notifier); =20 - g_object_set(ddc->iface_mouse, - "is-absolute", qemu_input_is_absolute(), - NULL); + dbus_mouse_update_is_absolute(ddc); } =20 int dbus_display_console_get_index(DBusDisplayConsole *ddc) @@ -491,6 +497,7 @@ dbus_display_console_new(DBusDisplay *display, QemuCons= ole *con) register_displaychangelistener(&ddc->dcl); ddc->mouse_mode_notifier.notify =3D dbus_mouse_mode_change; qemu_add_mouse_mode_change_notifier(&ddc->mouse_mode_notifier); + dbus_mouse_update_is_absolute(ddc); =20 return ddc; } --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077968; cv=none; d=zohomail.com; s=zohoarc; b=T0y3rsN4xK2xEtS/T27jvU6YsndAnCJzf+jIjBEQ34EjiRqazTl84hGCREbV3i8I8AguYwy+obDT0B6pClwP8kAjblaNl6ni151iv91ylHj8YuzTAghg3UaDzoC2pIMn3pMhCZ6ICapEkRHN0td8mzqK71x2sNnFcqK9dkpAfmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077968; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jV7bUQx7WiNczJSi/j6dogcwY/26ZVgR2AbJMGU524s=; b=aPsKwmVgtVT/QfrPxSpTO9SONemfC+mCFrIl0iXmL5AS4/mweh4ZE+mB+iHk0wXPtQ/BTzrZaQp6VXGfxyyEvUKAaGUeSbwFq3cwGI805GX4njhvDa7bVD6N7YeFkSbeq9lzfF1gkKxfXtmY+k+YH7yLaG7Z3SBEqUeNv8nv/dI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077968837466.5891965041077; Mon, 30 Jan 2023 03:26:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSHv-0006Vg-V9; Mon, 30 Jan 2023 06:25:31 -0500 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 1pMSHP-0006Qk-CV for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHO-00081r-4a for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:55 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-272-lTFOgaoaPNGwNH1rwHVsEg-1; Mon, 30 Jan 2023 06:24:51 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 69FAE8030CD for ; Mon, 30 Jan 2023 11:24:51 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0531BC15BAE; Mon, 30 Jan 2023 11:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077893; 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=jV7bUQx7WiNczJSi/j6dogcwY/26ZVgR2AbJMGU524s=; b=TiYf3CDXckvYfXut6caKfaTYUuW/PxqoXNSFqGGqAWzlv0ODCF2K4g8331l2KiHMxBd0CV h1oWQOJNbg0h5e00IisK6DaZ1b1qQxGx/C6cZdc4ocUcldhHtpZ1EDgGn2YpVJX5L299L4 CTgpXUFW+ln2UjPuHcgTdjTKFKacfC4= X-MC-Unique: lTFOgaoaPNGwNH1rwHVsEg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 04/11] ui/dbus: update the display when switching surface Date: Mon, 30 Jan 2023 15:24:24 +0400 Message-Id: <20230130112431.69559-5-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077970949100003 From: Marc-Andr=C3=A9 Lureau This seems to be the expected behaviour. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/dbus-listener.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index f9fc8eda51..620d9450cc 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -321,6 +321,8 @@ static void dbus_gfx_switch(DisplayChangeListener *dcl, /* why not call disable instead? */ return; } + + dbus_gfx_update(dcl, 0, 0, surface_width(ddl->ds), surface_height(ddl-= >ds)); } =20 static void dbus_mouse_set(DisplayChangeListener *dcl, --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077933; cv=none; d=zohomail.com; s=zohoarc; b=Q04ct/0yIOYy4ReMFqZH/TA8nQf7idkmIClyDo44G36Z/4HhOUv/BpOOkCF68x7SmIX2X+meyRSDy4cCEPXP4U9246WsnZuFLa7cCRzaqMBK+pfD1laGAYsRtIpNwIcFFTPu9RNeCYN9Cpv4drUbyROxFUJ8rAqEjENUbCWmAKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077933; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HSSDqvZiQqTqaxmrSZlQDien7yoxui2BoTT1Wb4Pgjs=; b=CgIqqcxkujMAUVc0f0tGfMzqvXuIOmQ9wE3M5W7V+lMXLfLBOFgoiO5Ri4vkiGtcU3Nn2tDHhSwo12Oj/N3eA4B0e8Ve9srRCGHmKchtScZvizeI5x7l4u8F/cIaW6dB5vru5yjIeyndKkdy8Sq4W1u27za+73ZZ31G5glfFAoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077933932557.7171379459718; Mon, 30 Jan 2023 03:25:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSHm-0006Tz-R5; Mon, 30 Jan 2023 06:25:19 -0500 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 1pMSHU-0006R4-N9 for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHR-000829-9G for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:24:58 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-t0whXX4tOqO2i0yZfZ9f5g-1; Mon, 30 Jan 2023 06:24:55 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3118B2999B26 for ; Mon, 30 Jan 2023 11:24:55 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CA8A140EBF5; Mon, 30 Jan 2023 11:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077896; 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=HSSDqvZiQqTqaxmrSZlQDien7yoxui2BoTT1Wb4Pgjs=; b=XG4RxK55D54Q7TYsUIEBmmD/y7vvdewTMoJJiXKRbCKVhvloXOhpWlvkNbbw/852XLk9wi w0dKe3k+gp70AUmYILqTiW0wPSweLQdL/T5CMzJh8W873LrWmffvoR+DaBMBG0FZfJTvFp v5jnJj1Z9CwLbzx68bptz3B5DXns1/k= X-MC-Unique: t0whXX4tOqO2i0yZfZ9f5g-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 05/11] meson: ensure dbus-display generated code is built before other units Date: Mon, 30 Jan 2023 15:24:25 +0400 Message-Id: <20230130112431.69559-6-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077934946100006 From: Marc-Andr=C3=A9 Lureau It's simply by luck that dbus-display header is built first before the other units using it. With sourceset, I can't find an easier way out than declaring an extra dependency for dbus-display1 generate code. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/meson.build b/ui/meson.build index 612ea2325b..0b2d0d21d1 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -83,7 +83,9 @@ if dbus_display '--interface-prefix', 'org.qemu.= ', '--c-namespace', 'QemuDBus', '--generate-c-code', '@BASENAME@= ']) - dbus_ss.add(when: [gio, pixman, opengl, gbm], + dbus_display1_lib =3D static_library('dbus-display1', dbus_display1, dep= endencies: gio) + dbus_display1_dep =3D declare_dependency(link_with: dbus_display1_lib, i= nclude_directories: include_directories('.')) + dbus_ss.add(when: [gio, pixman, opengl, gbm, dbus_display1_dep], if_true: [files( 'dbus-chardev.c', 'dbus-clipboard.c', @@ -91,7 +93,7 @@ if dbus_display 'dbus-error.c', 'dbus-listener.c', 'dbus.c', - ), dbus_display1]) + )]) ui_modules +=3D {'dbus' : dbus_ss} endif =20 --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077961; cv=none; d=zohomail.com; s=zohoarc; b=KIcHJh7luv5sZ+Qharr3EoItwcvhP6AQS+SolEElAGIGeurwcrTwoqBo7vFSgsVMsbaiLYGfcOn4blBchhg0Ur95TUxdx/TigsjmPxvoQUndwzS+p6xhIVrlm1j07qnFxIOcjxWbGYLhcYkaWx+9dzUJ2zku9vubZHMuZ2d97f0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077961; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GVyy6rATcfiYUPM0MkQZkA8NgRAxXFF1471V3qgMy8A=; b=BupESIQKg7rXjY2ja+N4O8SSc8/MOSCV2nQhl5KLr1NWr3JYWOoJFuuBmn6Ldbm+Uutj9GzwQb24/AhxXcyNTfmMKGw0teXMp3C0urq2faSGuhaTeP7ym97JucBi+6oDiFObYXcbU0kC5zAxmKrjBRDGSiZ8k7PcF+wtDCTw8iw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077961287163.9309696456785; Mon, 30 Jan 2023 03:26:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSIA-0006WO-Q0; Mon, 30 Jan 2023 06:25:44 -0500 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 1pMSHd-0006US-RZ for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHW-00083g-C5 for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:04 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-Rs4C7BZoNfiJef0o6jy8ug-1; Mon, 30 Jan 2023 06:24:59 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B147985C069 for ; Mon, 30 Jan 2023 11:24:59 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0341492B01; Mon, 30 Jan 2023 11:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077901; 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=GVyy6rATcfiYUPM0MkQZkA8NgRAxXFF1471V3qgMy8A=; b=cYB3aITgk2sOE7QM5TfvD/THxvlRMk/zy+9lxoQ+XvaLzwmtD4oJuF9+ui5Wb5wCMBcADO 0ibBBXd7Klf9EVyirIWwPalGWjqd8gJyEjn/yf4XZ3W3mgd9jhTEhm49Hk1MnlP2VZzwun xKNoncGUdlQFlUhbLyBrCmPMATFLHeM= X-MC-Unique: Rs4C7BZoNfiJef0o6jy8ug-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 06/11] ui: rename cursor_{put->unref} Date: Mon, 30 Jan 2023 15:24:26 +0400 Message-Id: <20230130112431.69559-7-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077962901100003 From: Marc-Andr=C3=A9 Lureau The naming is more conventional in QEMU. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 2 +- hw/display/qxl-render.c | 4 ++-- hw/display/qxl.c | 2 +- hw/display/vmware_vga.c | 4 ++-- ui/cursor.c | 2 +- ui/dbus-listener.c | 2 +- ui/spice-display.c | 4 ++-- ui/vnc.c | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 8e6cf782a1..ec28402a4f 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -153,7 +153,7 @@ typedef struct QEMUCursor { =20 QEMUCursor *cursor_alloc(int width, int height); void cursor_get(QEMUCursor *c); -void cursor_put(QEMUCursor *c); +void cursor_unref(QEMUCursor *c); QEMUCursor *cursor_builtin_hidden(void); QEMUCursor *cursor_builtin_left_ptr(void); void cursor_print_ascii_art(QEMUCursor *c, const char *prefix); diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index fcfd40c3ac..ec99ec887a 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -290,7 +290,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCur= sor *cursor, return c; =20 fail: - cursor_put(c); + cursor_unref(c); return NULL; } =20 @@ -336,7 +336,7 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt = *ext) } qemu_mutex_lock(&qxl->ssd.lock); if (qxl->ssd.cursor) { - cursor_put(qxl->ssd.cursor); + cursor_unref(qxl->ssd.cursor); } qxl->ssd.cursor =3D c; qxl->ssd.mouse_x =3D cmd->u.set.position.x; diff --git a/hw/display/qxl.c b/hw/display/qxl.c index ec712d3ca2..80ce1e9a93 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -299,7 +299,7 @@ void qxl_spice_reset_cursor(PCIQXLDevice *qxl) qxl->guest_cursor =3D 0; qemu_mutex_unlock(&qxl->track_lock); if (qxl->ssd.cursor) { - cursor_put(qxl->ssd.cursor); + cursor_unref(qxl->ssd.cursor); } qxl->ssd.cursor =3D cursor_builtin_hidden(); } diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 59ae7f74b8..09591fbd39 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -550,12 +550,12 @@ static inline void vmsvga_cursor_define(struct vmsvga= _state_s *s, default: fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n", __func__, c->bpp); - cursor_put(qc); + cursor_unref(qc); qc =3D cursor_builtin_left_ptr(); } =20 dpy_cursor_define(s->vga.con, qc); - cursor_put(qc); + cursor_unref(qc); } #endif =20 diff --git a/ui/cursor.c b/ui/cursor.c index 835f0802f9..31b09bf058 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -111,7 +111,7 @@ void cursor_get(QEMUCursor *c) c->refcount++; } =20 -void cursor_put(QEMUCursor *c) +void cursor_unref(QEMUCursor *c) { if (c =3D=3D NULL) return; diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 620d9450cc..cc1054caff 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -346,7 +346,7 @@ static void dbus_cursor_define(DisplayChangeListener *d= cl, c->data, c->width * c->height * 4, TRUE, - (GDestroyNotify)cursor_put, + (GDestroyNotify)cursor_unref, c); =20 qemu_dbus_display1_listener_call_cursor_define( diff --git a/ui/spice-display.c b/ui/spice-display.c index 0616a6982f..161868735b 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -463,7 +463,7 @@ void qemu_spice_cursor_refresh_bh(void *opaque) qemu_mutex_unlock(&ssd->lock); dpy_cursor_define(ssd->dcl.con, c); qemu_mutex_lock(&ssd->lock); - cursor_put(c); + cursor_unref(c); } =20 if (ssd->mouse_x !=3D -1 && ssd->mouse_y !=3D -1) { @@ -765,7 +765,7 @@ static void display_mouse_define(DisplayChangeListener = *dcl, =20 qemu_mutex_lock(&ssd->lock); cursor_get(c); - cursor_put(ssd->cursor); + cursor_unref(ssd->cursor); ssd->cursor =3D c; ssd->hot_x =3D c->hot_x; ssd->hot_y =3D c->hot_y; diff --git a/ui/vnc.c b/ui/vnc.c index d9eacad759..0bdcc3dfce 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1029,7 +1029,7 @@ static void vnc_dpy_cursor_define(DisplayChangeListen= er *dcl, VncDisplay *vd =3D container_of(dcl, VncDisplay, dcl); VncState *vs; =20 - cursor_put(vd->cursor); + cursor_unref(vd->cursor); g_free(vd->cursor_mask); =20 vd->cursor =3D c; --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675078010; cv=none; d=zohomail.com; s=zohoarc; b=XV5cT+QuQJGNFGrjAjc3wDH8WCJ9Nam0HjDsLqLvOXJckUtAupQiYjGWP4Arha3IaOsAIh7G3KVXBqb35flIIvGXS39JhRjceSb3z6RQceXlXz/JoOIwzCxEuwsX5iys5fQPwef9ZdPa/SoG+fz4uVemeqhYBJXWxx1+58ADSOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675078010; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=r6b9ziOQrlXA05O6Uk2/ZcTBYA6X5eIKyv5woXsURpc=; b=SWUwCYF6rn97uObW8ujb5hGkHl2wdE1yaklqrbgUAXL3qhytgI22ENuCUYHf3tGp4eFXtF2X5oQT7WBdOv1MSBSPejWyqjc9eVw4i2tEEnKJabzFdHue06V8XLde+0N6kXjrIOkOdzZy7yIPpw5J+kVlj+vBrTmbESbls6WFK1E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675078010223495.5231544562828; Mon, 30 Jan 2023 03:26:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSIn-0008Pq-6y; Mon, 30 Jan 2023 06:26:21 -0500 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 1pMSHt-0006Vw-Et for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHc-0008HZ-GA for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:13 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-212-BaGEiG5sPGaJJ9pg5P9-YQ-1; Mon, 30 Jan 2023 06:25:04 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EABD329AA3AD for ; Mon, 30 Jan 2023 11:25:03 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20D90492B01; Mon, 30 Jan 2023 11:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077905; 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=r6b9ziOQrlXA05O6Uk2/ZcTBYA6X5eIKyv5woXsURpc=; b=BMdXjgol7PQhJrGtr42pJtJnAAaAyhh2cqcTv5We+7CVr5MJ0J8GjIzhYehPrgyM1VikbR cMsjS3xFGqhaENY/+MyabrIr4KUaKAE85EqryARjmhtijaJGCmUHPaXhVOZOf5UpnLC+5K /YxKZYO6/470+E6A4dwYOo5tiv0moqk= X-MC-Unique: BaGEiG5sPGaJJ9pg5P9-YQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 07/11] ui: rename cursor_{get->ref}, return it Date: Mon, 30 Jan 2023 15:24:27 +0400 Message-Id: <20230130112431.69559-8-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675078011125100001 From: Marc-Andr=C3=A9 Lureau The naming is more conventional in QEMU code, and allows to simplify some code. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 2 +- ui/cursor.c | 3 ++- ui/dbus-listener.c | 3 +-- ui/spice-display.c | 4 ++-- ui/vnc.c | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index ec28402a4f..3afb5c73a8 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -152,7 +152,7 @@ typedef struct QEMUCursor { } QEMUCursor; =20 QEMUCursor *cursor_alloc(int width, int height); -void cursor_get(QEMUCursor *c); +QEMUCursor *cursor_ref(QEMUCursor *c); void cursor_unref(QEMUCursor *c); QEMUCursor *cursor_builtin_hidden(void); QEMUCursor *cursor_builtin_left_ptr(void); diff --git a/ui/cursor.c b/ui/cursor.c index 31b09bf058..6fe67990e2 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -106,9 +106,10 @@ QEMUCursor *cursor_alloc(int width, int height) return c; } =20 -void cursor_get(QEMUCursor *c) +QEMUCursor *cursor_ref(QEMUCursor *c) { c->refcount++; + return c; } =20 void cursor_unref(QEMUCursor *c) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index cc1054caff..f195d8df57 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -340,14 +340,13 @@ static void dbus_cursor_define(DisplayChangeListener = *dcl, DBusDisplayListener *ddl =3D container_of(dcl, DBusDisplayListener, dc= l); GVariant *v_data =3D NULL; =20 - cursor_get(c); v_data =3D g_variant_new_from_data( G_VARIANT_TYPE("ay"), c->data, c->width * c->height * 4, TRUE, (GDestroyNotify)cursor_unref, - c); + cursor_ref(c)); =20 qemu_dbus_display1_listener_call_cursor_define( ddl->proxy, diff --git a/ui/spice-display.c b/ui/spice-display.c index 161868735b..918cadecf1 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -459,7 +459,7 @@ void qemu_spice_cursor_refresh_bh(void *opaque) if (ssd->cursor) { QEMUCursor *c =3D ssd->cursor; assert(ssd->dcl.con); - cursor_get(c); + cursor_ref(c); qemu_mutex_unlock(&ssd->lock); dpy_cursor_define(ssd->dcl.con, c); qemu_mutex_lock(&ssd->lock); @@ -764,7 +764,7 @@ static void display_mouse_define(DisplayChangeListener = *dcl, SimpleSpiceDisplay *ssd =3D container_of(dcl, SimpleSpiceDisplay, dcl); =20 qemu_mutex_lock(&ssd->lock); - cursor_get(c); + cursor_ref(c); cursor_unref(ssd->cursor); ssd->cursor =3D c; ssd->hot_x =3D c->hot_x; diff --git a/ui/vnc.c b/ui/vnc.c index 0bdcc3dfce..8aec5d751e 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1032,8 +1032,7 @@ static void vnc_dpy_cursor_define(DisplayChangeListen= er *dcl, cursor_unref(vd->cursor); g_free(vd->cursor_mask); =20 - vd->cursor =3D c; - cursor_get(vd->cursor); + vd->cursor =3D cursor_ref(vd->cursor); vd->cursor_msize =3D cursor_get_mono_bpl(c) * c->height; vd->cursor_mask =3D g_malloc0(vd->cursor_msize); cursor_get_mono_mask(c, 0, vd->cursor_mask); --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077996; cv=none; d=zohomail.com; s=zohoarc; b=Fk8Tb+vA3WOh9ZrzSE7b6tfOI7jV4URKu0JEEUULurFhCtUleKWgOZJVRX3+H9SvJfQdxJwOCDvtXyl1RTdgt+3QRLtgSQiTywOt+C/yIIRK7p/0xwXhHOR5aGfIoEFebcKWdd2qw3lbj/B+eoKfCyat1X5C5/KBztynky8xDyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077996; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=D0NMcNO6/51Fu/VS0lTmBN7sXx0ZBFyu0L1jNrhRXXM=; b=gA7QoCgGuh2GFG3/FLjQO7i6tBwkB3kFEsOYzCBYhXbubTwan4mDZcm6NoJFPWGfzZI+zIGkNp4LxcF9B1jtFH631uAhso+hv8OuZtBSjv8Aw55fDUzB8WYJTE4djhtARLXRC2FbA8kOF2kk042EkO4UIFryUtBUipzhVxs8FHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167507799641283.7418064327926; Mon, 30 Jan 2023 03:26:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSIb-0007e6-Le; Mon, 30 Jan 2023 06:26:09 -0500 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 1pMSIA-0006kQ-A8 for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:43 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSHs-0008JA-L9 for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:28 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-298-SxW4asfkO1WHo-NO6bFipA-1; Mon, 30 Jan 2023 06:25:08 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EBC282999B25 for ; Mon, 30 Jan 2023 11:25:07 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B92B1121315; Mon, 30 Jan 2023 11:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077911; 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=D0NMcNO6/51Fu/VS0lTmBN7sXx0ZBFyu0L1jNrhRXXM=; b=cGSAVIj4lpE9DkC8CPiQLFIH7KzRqtU9Wi734YyJnvSSl5RB7Pct/+2hf4MM1I5tfHjinP p3du0DrDmRVDo4vF3rqU+KxS4qUj34AhVhxB2lwsgPrzWBkWmy8GGYNS9Z0D8UZeS3GBSy gVheKRcPX8+lXD7E5zfBBaJ1Jkv0nHM= X-MC-Unique: SxW4asfkO1WHo-NO6bFipA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 08/11] ui: keep current cursor with QemuConsole Date: Mon, 30 Jan 2023 15:24:28 +0400 Message-Id: <20230130112431.69559-9-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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+importer2=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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077997133100001 From: Marc-Andr=C3=A9 Lureau Keeping the current cursor around is useful, not only for VNC, but for other displays. Let's move it down, see the following patches for other usages. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 1 + ui/vnc.h | 1 - ui/console.c | 8 ++++++++ ui/vnc.c | 7 ++----- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 3afb5c73a8..e87284da22 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -460,6 +460,7 @@ QemuConsole *qemu_console_lookup_by_device(DeviceState = *dev, uint32_t head); QemuConsole *qemu_console_lookup_by_device_name(const char *device_id, uint32_t head, Error **err= p); QemuConsole *qemu_console_lookup_unused(void); +QEMUCursor *qemu_console_get_cursor(QemuConsole *con); bool qemu_console_is_visible(QemuConsole *con); bool qemu_console_is_graphic(QemuConsole *con); bool qemu_console_is_fixedsize(QemuConsole *con); diff --git a/ui/vnc.h b/ui/vnc.h index a60fb13115..757fa83044 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -159,7 +159,6 @@ struct VncDisplay QKbdState *kbd; QemuMutex mutex; =20 - QEMUCursor *cursor; int cursor_msize; uint8_t *cursor_mask; =20 diff --git a/ui/console.c b/ui/console.c index ab43561fe1..4e88941165 100644 --- a/ui/console.c +++ b/ui/console.c @@ -93,6 +93,7 @@ struct QemuConsole { uint32_t head; QemuUIInfo ui_info; QEMUTimer *ui_timer; + QEMUCursor *cursor; const GraphicHwOps *hw_ops; void *hw; =20 @@ -1922,6 +1923,8 @@ void dpy_cursor_define(QemuConsole *con, QEMUCursor *= cursor) DisplayState *s =3D con->ds; DisplayChangeListener *dcl; =20 + cursor_unref(con->cursor); + con->cursor =3D cursor_ref(cursor); if (!qemu_console_is_visible(con)) { return; } @@ -2287,6 +2290,11 @@ QemuConsole *qemu_console_lookup_unused(void) return NULL; } =20 +QEMUCursor *qemu_console_get_cursor(QemuConsole *con) +{ + return con->cursor; +} + bool qemu_console_is_visible(QemuConsole *con) { return (con =3D=3D active_console) || (con->dcls > 0); diff --git a/ui/vnc.c b/ui/vnc.c index 8aec5d751e..bbd8b6baae 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -988,10 +988,10 @@ static void vnc_mouse_set(DisplayChangeListener *dcl, =20 static int vnc_cursor_define(VncState *vs) { - QEMUCursor *c =3D vs->vd->cursor; + QEMUCursor *c =3D qemu_console_get_cursor(vs->vd->dcl.con); int isize; =20 - if (!vs->vd->cursor) { + if (!c) { return -1; } =20 @@ -1029,10 +1029,7 @@ static void vnc_dpy_cursor_define(DisplayChangeListe= ner *dcl, VncDisplay *vd =3D container_of(dcl, VncDisplay, dcl); VncState *vs; =20 - cursor_unref(vd->cursor); g_free(vd->cursor_mask); - - vd->cursor =3D cursor_ref(vd->cursor); vd->cursor_msize =3D cursor_get_mono_bpl(c) * c->height; vd->cursor_mask =3D g_malloc0(vd->cursor_msize); cursor_get_mono_mask(c, 0, vd->cursor_mask); --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077980; cv=none; d=zohomail.com; s=zohoarc; b=gXBj+7Oi+frHmaC55g1lhGV8VvGlffIWqQVxULs7IdgzJwpwszRCp79JynOnBjh73yq1zqIhB9VNrS9ZTNVuVZFEfpGd3hrbdfzXrJuF5+baLTrZgdTof1ij32XuGLvrebGAgxI6kjPACm2CSeq4uCUDuJ8iNqxtzu9rJ0qZsd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077980; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bf3O5qwvj5pCTSxDr7vWJJGwvGmi5G02K3Zb8H+/cZQ=; b=Jg8yDxBQRDl12XUG0fz2Cbxqn+CwoqKKWRukkpSMRwEsYHLwEdSSIX3pFy4i1SyiVX8pKznPR4fXP4EXt/75u62fnOKwh5D9HItuXKU6+qHiEwTJEfL+uBWtbikjepJHsGuqvWftLBf80ZYBiDlLcZc1tlP8rwTLFde+zEe9ONY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077980458376.6923291812478; Mon, 30 Jan 2023 03:26:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSIc-0007fC-Vh; Mon, 30 Jan 2023 06:26:11 -0500 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 1pMSID-0006p2-Jc for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSI6-0008OX-7I for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:45 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-NF6BOICcN-ugT784fRvnlA-1; Mon, 30 Jan 2023 06:25:34 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DA16D85C064 for ; Mon, 30 Jan 2023 11:25:33 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B5DD40C1255; Mon, 30 Jan 2023 11:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077935; 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=bf3O5qwvj5pCTSxDr7vWJJGwvGmi5G02K3Zb8H+/cZQ=; b=aNYN4TFXrUH6CAADL6jmf/h9YJvYgPw0y/5BwQs0O6Hzy4l+DeNoHMuOznkukWrUydZt4S fgtw2gHSosRwQv0syigd7SnULo7J1UcO3x+M2zoAdRatntuH+Dt8aYhC3FI4goi5w9gDbR cnt3MPzEgYANqxZQZUNS9+NkUPnUUFk= X-MC-Unique: NF6BOICcN-ugT784fRvnlA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 09/11] ui: set cursor upon listener registration Date: Mon, 30 Jan 2023 15:24:29 +0400 Message-Id: <20230130112431.69559-10-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077980993100001 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/console.c b/ui/console.c index 4e88941165..3fc8bf2fbc 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1661,6 +1661,9 @@ void register_displaychangelistener(DisplayChangeList= ener *dcl) con =3D active_console; } displaychangelistener_display_console(dcl, con, dcl->con ? &error_fata= l : NULL); + if (con->cursor && dcl->ops->dpy_cursor_define) { + dcl->ops->dpy_cursor_define(dcl, con->cursor); + } text_console_update_cursor(NULL); } =20 --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675077991; cv=none; d=zohomail.com; s=zohoarc; b=kvGNMf+zJb3uGBUUz7TDW/mmpbqT6YFfRgamvgmNkfX2dXY8KvDGf+4hDocOk76c0SRGBVQGonckw6o0xPddZGQB810rpjcjZmpq9Z5HeF3fWxrsUVw4+6t0hz3LdetAogBe8tBFJ4zRtcxMcXwsxwtEaAMO4T6wtmxB+lDWEow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675077991; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s0279tsYaFiBEs2+IccnKxGOwTiEOv91cmFd0uo/o4E=; b=BwBKWIAoB9CYpkA4KOH+1Oqk/6x6oVyKX1UuC2szxS2Nhg5oiTiLb4P3RgwwAXScvofhNVYKJKb/dgMCK9Pke9K659wufOyO3Y3nG3axiZNpKJER8IZLwmAzXYkE/0815G4feRlISmG6AacWL+p7/aPCw0QKpWkm7tPVLCQlMjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675077991200951.7196926242899; Mon, 30 Jan 2023 03:26:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSIk-00088Y-Rk; Mon, 30 Jan 2023 06:26:19 -0500 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 1pMSIH-0006r1-8K for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSIC-0008Ov-6N for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:46 -0500 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-203-gUEk5bedP3OdSDzW3ZhDaw-1; Mon, 30 Jan 2023 06:25:39 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DABB23C025D9 for ; Mon, 30 Jan 2023 11:25:38 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8209A492B01; Mon, 30 Jan 2023 11:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077940; 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=s0279tsYaFiBEs2+IccnKxGOwTiEOv91cmFd0uo/o4E=; b=SOfRn2jd5AHaT8cIMKN95r7Ob3TuXaV5euFVmX6ijBEjccXSVpLEpEx8CUYKb8zf/aPQ8J OwfMKpeSYTtZvzmmz+HV3plY3OTA4UhKXc7wPBBoUV2leH0rqP1kYsdcKmrMqUWf13w1N1 XX6niPi3iSxX6WqIaDgwgCZwo9ADSyc= X-MC-Unique: gUEk5bedP3OdSDzW3ZhDaw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 10/11] ui: set cursor position upon listener registration Date: Mon, 30 Jan 2023 15:24:30 +0400 Message-Id: <20230130112431.69559-11-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675077993027100003 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/console.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/console.c b/ui/console.c index 3fc8bf2fbc..6f87158c2d 100644 --- a/ui/console.c +++ b/ui/console.c @@ -94,6 +94,7 @@ struct QemuConsole { QemuUIInfo ui_info; QEMUTimer *ui_timer; QEMUCursor *cursor; + int cursor_x, cursor_y, cursor_on; const GraphicHwOps *hw_ops; void *hw; =20 @@ -1664,6 +1665,9 @@ void register_displaychangelistener(DisplayChangeList= ener *dcl) if (con->cursor && dcl->ops->dpy_cursor_define) { dcl->ops->dpy_cursor_define(dcl, con->cursor); } + if (dcl->ops->dpy_mouse_set) { + dcl->ops->dpy_mouse_set(dcl, con->cursor_x, con->cursor_y, con->cu= rsor_on); + } text_console_update_cursor(NULL); } =20 @@ -1908,6 +1912,9 @@ void dpy_mouse_set(QemuConsole *con, int x, int y, in= t on) DisplayState *s =3D con->ds; DisplayChangeListener *dcl; =20 + con->cursor_x =3D x; + con->cursor_y =3D y; + con->cursor_on =3D on; if (!qemu_console_is_visible(con)) { return; } --=20 2.39.1 From nobody Fri Apr 26 09:24:27 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1675078000; cv=none; d=zohomail.com; s=zohoarc; b=Nnp8pL4s1uqQka2qqU3RIq6ZLhniESnd43qcYew3Yhf9JjqgE6LD1CrZZ7idQOelIMrXKF6FIUGDRo7LQ6PD9cGmf1j7XsvfL64Uo6PCF18LrEBk6KaYhrfavdkNn1JPBhWVXJMAyNg3cyLqNfNYJaBe5ztIf+HAhkCVSbfIndA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675078000; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DqnBGgS558Elqkbht6uWfnsyLmdI55OPGuBv8KeYBbE=; b=dhsen5IqxOZRtmz0kp7NgD0HXdv10/25d1XeJgq7pet4MGObWmw0yZgb/gKNvFr9udz6gdIlCnU6VswfdJLcBmnf0iZKJ3pJ3HTycVfhLjpDfETXCO/IUBUMSSjhslwxBS4uUnaFj34m5szxdO1EV9w/53q14hG83tGjPiYvjoQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675078000045471.5858694185042; Mon, 30 Jan 2023 03:26:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMSIm-0008Hn-Ef; Mon, 30 Jan 2023 06:26:20 -0500 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 1pMSIH-0006r2-9c for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMSIE-0008Rg-3C for qemu-devel@nongnu.org; Mon, 30 Jan 2023 06:25:47 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-85-4qZRrKhlMx6KSBAUKV5suQ-1; Mon, 30 Jan 2023 06:25:43 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F7C9811E9C for ; Mon, 30 Jan 2023 11:25:43 +0000 (UTC) Received: from localhost (unknown [10.39.208.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 548E8492B01; Mon, 30 Jan 2023 11:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675077945; 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=DqnBGgS558Elqkbht6uWfnsyLmdI55OPGuBv8KeYBbE=; b=T2V2+tidaFN80iNIKJZQPdYeCWrag5xT9O444S3o3Z0m9v5FoCqDQJpUPPf6/9incu5hk8 9lEpbgSDnk3zm5i1CvkLtLLg/p6geQ5sszf4RYSbYMtzTmBS+dxwhY0RehrkgYLAC4RSIs kIHenyaVxof8HRVp/k7DxdSuVfvTvEA= X-MC-Unique: 4qZRrKhlMx6KSBAUKV5suQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH 11/11] ui/sdl: get the GL context from the window Date: Mon, 30 Jan 2023 15:24:31 +0400 Message-Id: <20230130112431.69559-12-marcandre.lureau@redhat.com> In-Reply-To: <20230130112431.69559-1-marcandre.lureau@redhat.com> References: <20230130112431.69559-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675078001104100001 From: Marc-Andr=C3=A9 Lureau There is no guarantee to have a current GL context here. The current code seems to rely on the renderer using a GL backend, and to set a current GL context. But this is not always the case, for example if the renderer backend is DirectX. This change is enough to fix using virgl with sdl2 on win32, on my setup. Signed-off-by: Marc-Andr=C3=A9 Lureau --- ui/sdl2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 8cb77416af..f259e4c4d1 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -101,7 +101,7 @@ void sdl2_window_create(struct sdl2_console *scon) flags); scon->real_renderer =3D SDL_CreateRenderer(scon->real_window, -1, 0); if (scon->opengl) { - scon->winctx =3D SDL_GL_GetCurrentContext(); + scon->winctx =3D SDL_GL_CreateContext(scon->real_window); } sdl_update_caption(scon); } --=20 2.39.1