From nobody Mon Feb 9 17:25:05 2026 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 ARC-Seal: i=1; a=rsa-sha256; t=1610706803; cv=none; d=zohomail.com; s=zohoarc; b=Clp9vfDXD57IdTOUWNTO1/cToKPfuzjA954RMWp3fSanWjU8EV/QvdcvmzR1vCf0BTDx+sYn5fzUpJIWFLnUhVg9i9NC3jKcNMqFeEXvZWhQ3pWGAgWqWGVPlFb12CxpnLjDkt2OhFbNkKbktrbg4PAchkDluiXEGNM+Oi/Q+B4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610706803; 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=iFehVGefFU0nz09U9T1DXqix/akxYDtGmT4nMAfVuVg=; b=B7YbvQGIWZQXJtBBxjbwBvQENGZ7jn+OlS+j6R1qSITeWg6CzlzX9N5TDkAzhDOOQPweh/WVGikZ9+QCSsRjygAtMl1fN9/xQKToVwqZaBR37WyFI1Gl66PWnFBkwBYejMIYW7pi94TdV6lxU+FyOsklnbvVP3jktYX9fygldvc= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610706803872133.0110051224617; Fri, 15 Jan 2021 02:33:23 -0800 (PST) Received: from localhost ([::1]:56038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0MPy-0004vh-LH for importer@patchew.org; Fri, 15 Jan 2021 05:33:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0MHa-0003A4-8k for qemu-devel@nongnu.org; Fri, 15 Jan 2021 05:24:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l0MHY-0007w9-MF for qemu-devel@nongnu.org; Fri, 15 Jan 2021 05:24:42 -0500 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-72-i09v4G3RMTybzFfGjff6mQ-1; Fri, 15 Jan 2021 05:24:37 -0500 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 0E6CC180A092 for ; Fri, 15 Jan 2021 10:24:37 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-182.ams2.redhat.com [10.36.112.182]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BFFEC5C1A3; Fri, 15 Jan 2021 10:24:30 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DF6F4180063F; Fri, 15 Jan 2021 11:24:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610706280; 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=iFehVGefFU0nz09U9T1DXqix/akxYDtGmT4nMAfVuVg=; b=Kh7tcumhZIR/BlyI8VdrDMpv9TMZgtMg7sNvZcM6x8ZRbre6O1jynpVv/ay1xx7GLeqyZy d42MekxPa8Gh1n3AtB7EQJbaRXrpSOElHan25P2gfVGt1ASQta9rQvMomh2RmLDoPgCpNH Ae43VHmlUAnWr6d73kHZIAkUlsGKql4= X-MC-Unique: i09v4G3RMTybzFfGjff6mQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 09/11] vnc: move check into vnc_cursor_define Date: Fri, 15 Jan 2021 11:24:22 +0100 Message-Id: <20210115102424.1360437-10-kraxel@redhat.com> In-Reply-To: <20210115102424.1360437-1-kraxel@redhat.com> References: <20210115102424.1360437-1-kraxel@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=kraxel@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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.248, 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.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Move the check whenever a cursor exists into the vnc_cursor_define() function so callers don't have to do it. Suggested-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20210112134120.2031837-2-kraxel@redhat.com --- ui/vnc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index d4854d351bac..0f01481cac57 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -793,9 +793,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl, QTAILQ_FOREACH(vs, &vd->clients, next) { vnc_colordepth(vs); vnc_desktop_resize(vs); - if (vs->vd->cursor) { - vnc_cursor_define(vs); - } + vnc_cursor_define(vs); memset(vs->dirty, 0x00, sizeof(vs->dirty)); vnc_set_area_dirty(vs->dirty, vd, 0, 0, vnc_width(vd), @@ -929,6 +927,10 @@ static int vnc_cursor_define(VncState *vs) QEMUCursor *c =3D vs->vd->cursor; int isize; =20 + if (!vs->vd->cursor) { + return -1; + } + if (vnc_has_feature(vs, VNC_FEATURE_ALPHA_CURSOR)) { vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); @@ -2155,9 +2157,7 @@ static void set_encodings(VncState *vs, int32_t *enco= dings, size_t n_encodings) vnc_desktop_resize(vs); check_pointer_type_change(&vs->mouse_mode_notifier, NULL); vnc_led_state_change(vs); - if (vs->vd->cursor) { - vnc_cursor_define(vs); - } + vnc_cursor_define(vs); } =20 static void set_pixel_conversion(VncState *vs) --=20 2.29.2