From nobody Thu May 9 02:12:29 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 ARC-Seal: i=1; a=rsa-sha256; t=1677573142; cv=none; d=zohomail.com; s=zohoarc; b=hrK+nB9H/N0AnwwL7gaZeE8VK/6PZIfX3cwU+N0I5KRIfT8fppUqeYIAXXw5DDGpekp5kWzKePa8l10Lh9uXhzgxZ5nshi0VJkIhrC839tzgsqJ05YDZv5/zaRTYZav3xUdYc6Lw0QswjWkQhxQKzBcwwrKHF0f0/gSJAMC29NU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677573142; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject; bh=dtaVeFaGDQJ+M6OvzwKHmn2qzQLBA1m0UYmlyf2ZwYY=; b=WIV4qqLzIbm6Lde/R3/Mt8/bikRxF7h2NxFQGFXATemCtjDKlk7dqrjnprybNa6qX1c3dDOqWj8Nva+poQij+i/LEl1Mv1JSSnalP6tIQnBzev4QCN8oLFqrBkB/sfbn0/jUrj7JY8q3+1SHi/aO0S7uizidXVP4lzgaV4UG3kY= 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677573142733598.8695148973579; Tue, 28 Feb 2023 00:32:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWvOV-00073h-Qe; Tue, 28 Feb 2023 03:31:32 -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 1pWvOU-0006yt-DO for qemu-devel@nongnu.org; Tue, 28 Feb 2023 03:31:30 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWvOS-0007DN-8w for qemu-devel@nongnu.org; Tue, 28 Feb 2023 03:31:29 -0500 Received: by mail-pl1-x62a.google.com with SMTP id bh1so9573048plb.11 for ; Tue, 28 Feb 2023 00:31:27 -0800 (PST) Received: from alarm.u-tokyo.ac.jp ([157.82.194.14]) by smtp.gmail.com with ESMTPSA id iz12-20020a170902ef8c00b0019945535973sm5952894plb.63.2023.02.28.00.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 00:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; t=1677573086; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dtaVeFaGDQJ+M6OvzwKHmn2qzQLBA1m0UYmlyf2ZwYY=; b=y8LotopNjIrO2jQ1GgeSV+tjOWJAWaRduZC8/W7IG9uYF1KEq9tS2dxpo9S4WiXcxi H2Yt+ekkv/0982cSBqvxMFNrgFQwg7nS8s5U4PmWR6v6TIwh7dclqDZsRq1j4BZ8G87s l5n+4rWRe0LlQmYlI9f9kCgMFW1xhOVQmFrjKlGBRYJA3g4qJONo8p0QH3gpAECpsI7j ouZ9509lIoHEnJOvR7YN83Mmg9lxBwDFtSEfit9CMgv1SE7afeHMV/bJF0L64sek3ddz 3tB5v9MdiXn0c/DoYw0/j1/SlEHlj+jw7086+YI9UC3yX+QhM7/W61CxBlj+UhCN2g0E erCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677573086; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dtaVeFaGDQJ+M6OvzwKHmn2qzQLBA1m0UYmlyf2ZwYY=; b=JwDhPvdGWWmXNyzbTl8AJ7tUylE7HUIiw3DsTGUfSJ8bNaUmga66ZCMcvISqoF/piz 1VpTpLHK9jVkV2sp/vpH+NcnRgWnbhzLGJNkRjnXvlvTTG1hv2EkzhNVSb8EoZ6ptOAs QXUIuDNuakuBeDSRVNCbk9EOTQ9p581RhI4DzJ3JiLLbzRGMdDTogR01XTdZ3yovb1fe dcmvEEtr2HYzEAUf1MLGx5JOb7UvTM3QkTUCBibhbK3B0Gt3SyqU4z/EF1DfBwEz83G6 p9mLsOm+zCxi4o3sshN1/QzhPtCZSrsaiGM9vCGFPPGMTiUyxJlRwBg/I+G8g08PG4GP JiUg== X-Gm-Message-State: AO0yUKUjJJK2D0Ty68uMRSxgY9ErPxF1GUXJIgqeEAVPiDv+1fMbVb9P /5/7F+0oO79QXO0XAQ7PQxFesE0boZnYekr1 X-Google-Smtp-Source: AK7set9YpVPRT6+MTeuXAx2P3WNAZA2T1ZVNNV//cR1LZnkyE86YcEGr4auEDuaaOlerr8Bb1131MA== X-Received: by 2002:a17:902:c941:b0:196:5787:d73a with SMTP id i1-20020a170902c94100b001965787d73amr2376929pla.53.1677573086178; Tue, 28 Feb 2023 00:31:26 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, Gustavo Noronha Silva , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Akihiko Odaki Subject: [PATCH] ui/cocoa: Override windowDidResignKey Date: Tue, 28 Feb 2023 17:31:19 +0900 Message-Id: <20230228083119.2863-1-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::62a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1677573144557100003 Content-Type: text/plain; charset="utf-8" This fixes pressed keys being stuck when the deck is clicked and the window loses focus. In the past, Gustavo Noronha Silva also had a patch to fix this issue though it only ungrabs mouse and does not release keys, and depends on another out-of-tree patch: https://github.com/akihikodaki/qemu/pull/3/commits/e906a80147b1dc6d4f31b6a0= 8064ef9871a2b76c Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 52e750f8a2..ac1cee09cd 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1330,10 +1330,15 @@ - (BOOL)windowShouldClose:(id)sender return NO; } =20 -/* Called when QEMU goes into the background */ -- (void) applicationWillResignActive: (NSNotification *)aNotification +/* + * Called when QEMU goes into the background. Note that + * [-NSWindowDelegate windowDidResignKey:] is used here instead of + * [-NSApplicationDelegate applicationWillResignActive:] because it cannot + * detect that the window loses focus when the deck is clicked on macOS 13= .2.1. + */ +- (void) windowDidResignKey: (NSNotification *)aNotification { - COCOA_DEBUG("QemuCocoaAppController: applicationWillResignActive\n"); + COCOA_DEBUG("%s\n", __func__); [cocoaView ungrabMouse]; [cocoaView raiseAllKeys]; } --=20 2.39.1