From nobody Mon Feb 9 21:21:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551090731733904.0881465296716; Mon, 25 Feb 2019 02:32:11 -0800 (PST) Received: from localhost ([127.0.0.1]:34855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyDYQ-00032g-Om for importer@patchew.org; Mon, 25 Feb 2019 05:32:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyDRf-0006SI-2p for qemu-devel@nongnu.org; Mon, 25 Feb 2019 05:25:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyDRZ-0003G5-GI for qemu-devel@nongnu.org; Mon, 25 Feb 2019 05:25:11 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:38763) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gyDRZ-00031q-34 for qemu-devel@nongnu.org; Mon, 25 Feb 2019 05:25:05 -0500 Received: by mail-wr1-x433.google.com with SMTP id v13so9262182wrw.5 for ; Mon, 25 Feb 2019 02:24:46 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id v10sm1764692wrn.26.2019.02.25.02.24.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 02:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OQubsVuFR/3sd2NQ4tJInwiBhLa2q6Blp0Uha5UjYKY=; b=Gmm/dKIuXWVIqy+n02OVc9/4yWqq8L+li2EJfkdMwntmm7aV4iU6ZH89q8WdBD4Hfh bQxQeb3aQirrQaRg44XL0JTseSfB+LNhQIxvndCfZzcj9uXyzKFBetMgUOGG2sSeMw0M TmN9WqmW6hXPF8FM5Lr5n/aLRh5kyL++IlZ9WG0YocanIwQu7NZYNI259mjjv6L3jZO2 iWwOinjnrku5PqrALZFZKTsR4A0UUvaaPdY6ilvC5nV2ceeQmnuEDC+I9hkPNJfTN3Xy sQUCYytBqXEOLkMNpkp/Y9THl0ZWnq1uIOeb9yPdpeOgYPQRmB5QdHExmFGp+vbCxkYp BNOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OQubsVuFR/3sd2NQ4tJInwiBhLa2q6Blp0Uha5UjYKY=; b=p1Tpgi970MIoUvHYfFDWmprcxMaLfxmx5qSiADVWYRjouIWC0XJWFMwkrUYwWaqD0N wKovDrGeICYA5QOZD14AOa+akvNccIQxf7F+gy+r3/ToBTompR+i4AtEjL/ob7LQN4uy skuTumHUTdM5Np5EKTDjD0GNrnYbRm5TEj/hfUuuJsyQQq6WQ92o3j6VatHBIxYeHzG6 eyt+Z99lQB41BeJ2IVuW5mNFjgG2STlvMlHwyM0Ly1dhBxUGsA0fU+Z4F13tqTAzEdbM 06VOIHMv/TEu+6N72B/wluEjlfUr7Z43zm9E18S2Fbr1/VqUf8htAoZ9XkNMaF2y0jZ5 F9fw== X-Gm-Message-State: AHQUAuZGMU1X4dMOqK7B9NX19Nr4K9qkbDY+L1SWB8/W8YxXkJF6Tth7 HGNIAFKm5Iw6Mpe0Mjj1d1Cvd1Qwil8= X-Google-Smtp-Source: AHgI3IYPg9H2DA00gWqAPpAfzF8KiIS8qJowQHIXtOKW4io1SOYRf2ec2ATp5c+vRvAosXgxAnCC8Q== X-Received: by 2002:adf:b784:: with SMTP id s4mr11715726wre.155.1551090285461; Mon, 25 Feb 2019 02:24:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 25 Feb 2019 10:24:32 +0000 Message-Id: <20190225102433.22401-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190225102433.22401-1-peter.maydell@linaro.org> References: <20190225102433.22401-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 Subject: [Qemu-devel] [PATCH v3 6/7] ui/cocoa: Subclass NSApplication so we can implement sendEvent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roman Bolshakov , patches@linaro.org, John Arbuckle , Gerd Hoffmann , Ben Hekster , Berkus Decker Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When we switch away from our custom event handling, we still want to be able to have first go at any events our application receives, because in full-screen mode we want to send key events to the guest, even if they would be menu item activation events. There are several ways we could do that, but one simple approach is to subclass NSApplication so we can implement a custom sendEvent method. Do that, but for the moment have our sendEvent just invoke the superclass method. Signed-off-by: Peter Maydell Reviewed-by: BALATON Zoltan Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov Message-id: 20190214102816.3393-7-peter.maydell@linaro.org --- ui/cocoa.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 1b54d42aba..00e3db69c9 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1482,6 +1482,17 @@ - (void)adjustSpeed:(id)sender =20 @end =20 +@interface QemuApplication : NSApplication +@end + +@implementation QemuApplication +- (void)sendEvent:(NSEvent *)event +{ + COCOA_DEBUG("QemuApplication: sendEvent\n"); + [super sendEvent: event]; +} +@end + static void create_initial_menus(void) { // Add menus @@ -1695,7 +1706,7 @@ int main (int argc, const char * argv[]) { ProcessSerialNumber psn =3D { 0, kCurrentProcess }; TransformProcessType(&psn, kProcessTransformToForegroundApplication); =20 - [NSApplication sharedApplication]; + [QemuApplication sharedApplication]; =20 create_initial_menus(); =20 --=20 2.17.2 (Apple Git-113)