From nobody Sun Nov 9 19:09:40 2025 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 1551718622301138.36024096110054; Mon, 4 Mar 2019 08:57:02 -0800 (PST) Received: from localhost ([127.0.0.1]:57245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0qte-00011S-5X for importer@patchew.org; Mon, 04 Mar 2019 11:56:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0qn4-0004Qb-2T for qemu-devel@nongnu.org; Mon, 04 Mar 2019 11:50:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0qn2-0005lF-8G for qemu-devel@nongnu.org; Mon, 04 Mar 2019 11:50:10 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:40940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h0qn2-0005ke-19 for qemu-devel@nongnu.org; Mon, 04 Mar 2019 11:50:08 -0500 Received: by mail-wr1-x42d.google.com with SMTP id q1so6331569wrp.7 for ; Mon, 04 Mar 2019 08:50:07 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id x74sm7238018wmf.22.2019.03.04.08.50.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 08:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=n6lY7pkDMpwdLdV8Ya73A0/SHkQC1GkvAVdq2F4IskM=; b=r3XckG6TI/fPx2NjEMrQCvIfnrNEeSl8b2ovQWT8Tlnvq9kkr6C2+yddX7hKPWzjuJ efVr3QaNWOxx8wm5fmUASUvwVz5t9gsXXtdF8KfasdSWPgJ3B5dR0l6ZyVl5U4UG/E8I 7j7l0IuAAMj0SDA6lVPbhu+PuGkp8GCEdFPMTbwuz+IthHAA8N+ePO6e0zqBjbtGPVs+ v+2MulJ7Vcg7HCSK/d8oJappoEtmq448THONZphg6BE/UdgpppfAGiwqwPPJ+1oIrrsx Q8D1CQtirWu4p4Z71lum8IMaMjyKx/ahvTuGgT/PWgZm0xANYgkW6fcW2+gqdFR307Xg X/bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n6lY7pkDMpwdLdV8Ya73A0/SHkQC1GkvAVdq2F4IskM=; b=U4KcOn6/1rioaNsJv2EBWimAgNz+J0daCyvWIDSOpFJ/oxMEbvy7v0OPfiYojACtW6 yFhYCnwpKMjJ2mISLyVNj6fhn/+95QfXnJRxvRBXgAERyAFaJXAG91oJ20HirFyVERjw /f60dkyfyXrIgoyxcTVX02bPzbS+aHEHFu6/RyxKNZRng8DXC1ExJ+YVJzteTTf1EZR7 W46LDVwu4rzN6Vp6d02z4NC0eLj+Psl9fpB8RvU04/S+ohxYeZqgzFAckE4ymupsEVwA zmZE8x1C1Y0U2QUlH78t/wpc4bHgnzEdusX1kWUpSObvDLsZZzp+aUJ1hnKme9UelvT3 rxSw== X-Gm-Message-State: APjAAAUiuv1CvFdopdonVsusdYHPBrd/JmCuG8xDxBgLyO2KrisK/MDh XqgsXJXLRFDZX6sIVqXijG8A65jLNdI= X-Google-Smtp-Source: APXvYqxIhcBp5ahHM51IBzm7Al6VCJ/m4YEs4JuBM+WV9yn+u66y53uYD6PnunVF+gTvyI4MOUXEyw== X-Received: by 2002:adf:b741:: with SMTP id n1mr12833962wre.287.1551718206884; Mon, 04 Mar 2019 08:50:06 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 4 Mar 2019 16:49:57 +0000 Message-Id: <20190304164958.9362-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190304164958.9362-1-peter.maydell@linaro.org> References: <20190304164958.9362-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::42d Subject: [Qemu-devel] [PULL 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: , 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: 20190225102433.22401-7-peter.maydell@linaro.org 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 1b54d42aba6..00e3db69c91 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1482,6 +1482,17 @@ QemuCocoaView *cocoaView; =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.20.1