From nobody Mon Feb 9 20:34:58 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=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1657664326; cv=none; d=zohomail.com; s=zohoarc; b=g+O3E+YWvMUhocrYpu4Ektzzi+1F5bHPqH6+yAQAQdhvcm5xMwVWd0a8CcOWZLhWdMFu+Z72vd/Tk1m5JvVVFYDNrOkYvuRGnVAOUJwPqe476FhnmW9um2uNUKC2okqzR8AwofbzmnSHwKEvL9hqT9YIyPJQXWudaBUUlmNkB8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657664326; 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:Reply-To:References:Sender:Subject:To; bh=iAKkygkMO1TUtVaK/7uVgYzViBXQ1KnHrGHWUDPP7AE=; b=mUMUeovHI9/MUdR4L1WCgPIsHtRtCvZX0GyaDZjrm49DFXDehghN4s1VBD8OYCVEGNWryFXXT1euqLnNjQjzo2RDnN+eqaKy9aTaTUqW6s13FzOtTlhIR8HlLtl1VWpwzLVQPSdxMw5FKd2UN9U+1yprSFbMxxMKfEE4zvTJBiU= 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=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 1657664326600217.73432718404058; Tue, 12 Jul 2022 15:18:46 -0700 (PDT) Received: from localhost ([::1]:33190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBODN-0002Ia-B5 for importer@patchew.org; Tue, 12 Jul 2022 18:18:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBOBV-0007cw-Hw for qemu-devel@nongnu.org; Tue, 12 Jul 2022 18:16:49 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:44786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBOBS-0002U1-Gn for qemu-devel@nongnu.org; Tue, 12 Jul 2022 18:16:48 -0400 Received: by mail-wm1-x334.google.com with SMTP id be14-20020a05600c1e8e00b003a04a458c54so185740wmb.3 for ; Tue, 12 Jul 2022 15:16:46 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id j5-20020adfea45000000b0021d6a23fdf3sm9212775wrn.15.2022.07.12.15.16.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Jul 2022 15:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iAKkygkMO1TUtVaK/7uVgYzViBXQ1KnHrGHWUDPP7AE=; b=P6jvTc26WoW9mGGPpngwUR0CDdsgB68NIOQTH35UuE23TcorudpzQkaMdakCmGk5U0 EDpZVITphXPqXyHQ+/zVaUpPwOoGhg7YxrnfxQ7HGZfDtHGXDIC+aPp0VmwX2dlElM7i TqprLGu0S//lTfI0CJ512FwPzobAETfSgoVfcWL/+aVBrwEU5/JA4QEIvpxfixbnLmqa XVMR/V9DmIdPyaHip4OjHKsU0CfAYqX/VoCI/xepmk6aevZ/AF6A901bWRoQAH7mBdNj gLsofPH2I9tAdJw8ugM9gV2RfPMcwpHGZm2nOpkTnv/6upppRk/EyZTlyQWF1A9hKK4U ppJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iAKkygkMO1TUtVaK/7uVgYzViBXQ1KnHrGHWUDPP7AE=; b=fTsXYkVKsP719Vt4kl73BnHqv2FJkbcpQW8majj9D8N661FxC113Ddo7kDRouAbnbl 5YO2crhjr57bnRLGZEsVNY5h6tWpkxpVKzuLEob3gzUnJsPGoFI+81dsPuu8NJ85ALIc ke/iGa45zJK1shzYOhLuVCDgae0QASBY7tnfKKF3FZoPOcXpLI20helNk6KDQF1EIAcS z5W+6CcOksBoMzx1IdOruZGF4R/t9DOzPTITy+wdjhJCYhswhnnLe7kTNevsBGtbfQ2Y YjhPtAHA0hQtiBKtQdTs9D1B+s1/suJkt1mDH8E8u8eWoiYZmZ+SRCi3MBa6Nn4CfbLY m9CA== X-Gm-Message-State: AJIora/P7By5vclium0T33ht/uzqeonsvL5MeDMf956HOWYa0BdqIs3w rCQO0n53XSUJEUvTSKGRGVuw/rwe1p5mbGOM X-Google-Smtp-Source: AGRyM1uqp1Zlw04TWTdCzEZBBEymzCc+K8V/sERb4NDmaPr/TjVN2xW+AH6cGmgSHkyLARdAVCGWGA== X-Received: by 2002:a05:600c:3507:b0:3a1:9fbb:4d62 with SMTP id h7-20020a05600c350700b003a19fbb4d62mr174945wmq.161.1657664205139; Tue, 12 Jul 2022 15:16:45 -0700 (PDT) To: qemu-devel@nongnu.org Cc: Roman Bolshakov , Akihiko Odaki , Thomas Huth , Cameron Esfahani , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Delevoryas Subject: [PULL 3/5] ui/cocoa: Fix switched_to_fullscreen warning Date: Wed, 13 Jul 2022 00:16:05 +0200 Message-Id: <20220712221607.9933-4-f4bug@amsat.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220712221607.9933-1-f4bug@amsat.org> References: <20220712221607.9933-1-f4bug@amsat.org> MIME-Version: 1.0 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=2a00:1450:4864:20::334; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= via X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1657664328883100001 From: Peter Delevoryas I noticed this error while building QEMU on Mac OS X: [1040/1660] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o ../ui/cocoa.m:803:17: warning: variable 'switched_to_fullscreen' set bu= t not used [-Wunused-but-set-variable] static bool switched_to_fullscreen =3D false; ^ 1 warning generated. I think the behavior is fine if you remove "switched_to_fullscreen", I can still switch in and out of mouse grabbed mode and fullscreen mode with this change, and Command keycodes will only be passed to the guest if the mouse is grabbed, which I think is the right behavior. I'm not sure why a static piece of state was needed to handle that in the first place. Perhaps the refactoring of the flags-state-change fixed that by toggling the Command keycode on. I tested this with an Ubuntu core image on macOS 12.4 wget https://cdimage.ubuntu.com/ubuntu-core/18/stable/current/ubuntu-co= re-18-i386.img.xz xz -d ubuntu-core-18-i386.img.xz qemu-system-x86_64 -drive file=3Dubuntu-core-18.i386.img,format=3Draw Fixes: 6d73bb643aa7 ("ui/cocoa: Clear modifiers whenever possible") Signed-off-by: Peter Delevoryas Reviewed-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20220702044304.90553-1-peter@pjd.dev> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- ui/cocoa.m | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 6a4dccff7f..e883c7466e 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -800,7 +800,6 @@ - (bool) handleEventLocked:(NSEvent *)event int buttons =3D 0; int keycode =3D 0; bool mouse_event =3D false; - static bool switched_to_fullscreen =3D false; // Location of event in virtual screen coordinates NSPoint p =3D [self screenLocationOfEvent:event]; NSUInteger modifiers =3D [event modifierFlags]; @@ -952,13 +951,6 @@ - (bool) handleEventLocked:(NSEvent *)event =20 // forward command key combos to the host UI unless the mouse = is grabbed if (!isMouseGrabbed && ([event modifierFlags] & NSEventModifie= rFlagCommand)) { - /* - * Prevent the command key from being stuck down in the gu= est - * when using Command-F to switch to full screen mode. - */ - if (keycode =3D=3D Q_KEY_CODE_F) { - switched_to_fullscreen =3D true; - } return false; } =20 --=20 2.36.1