From nobody Mon Nov 10 08:14:59 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 Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554690139255141.05274017654938; Sun, 7 Apr 2019 19:22:19 -0700 (PDT) Received: from localhost ([127.0.0.1]:46149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDJvA-0007nB-Tw for importer@patchew.org; Sun, 07 Apr 2019 22:22:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDJtq-0007Ag-Gn for qemu-devel@nongnu.org; Sun, 07 Apr 2019 22:20:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDJjK-0007mE-7r for qemu-devel@nongnu.org; Sun, 07 Apr 2019 22:09:51 -0400 Received: from pv50p00im-ztdg10011301.me.com ([17.58.6.40]:50197) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hDJjI-0007eD-46 for qemu-devel@nongnu.org; Sun, 07 Apr 2019 22:09:48 -0400 Received: from [172.18.2.102] (unknown [36.106.167.87]) by pv50p00im-ztdg10011301.me.com (Postfix) with ESMTPSA id C526964014E; Mon, 8 Apr 2019 02:09:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=04042017; t=1554689386; bh=r85ECKuF67mUDGh7vOGs3TQEScqrAFCmVVoxZZgaGic=; h=Content-Type:Mime-Version:Subject:From:Date:Message-Id:To; b=LIK2c7+caX6JfgEPxeUt5kAJLr55wmpFfwrg++YRp626e52CUOezYLaZMKFSO2Qz5 6MhsEpeDOkHOLsg66DtSkORvtBH/JKck44kZzGq+hNEdgjKlTHoClkrcLWocHXkiM8 OMlWNbOrRy1ism+WsYlDhhDjhtOSXxILHdIw8qhiLa5KT4fdyMBgGFcQnWfWsri1cv /cwWgesGL8xwNZZKQiJWcVMcGN6E0UdSwJg64npGoxTU+DVSViXHXAbpa0iHXumdfq UY+9hYawnSln2C9NauC3gViExU0HkMp2lfWf5duLnIzRWk/83WS5VaiTWK35AMPjYC kj5EQyymxmnUA== Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) In-Reply-To: Date: Mon, 8 Apr 2019 10:09:42 +0800 Content-Transfer-Encoding: quoted-printable Message-Id: <91053E16-BF23-405F-971F-8042EEA50408@me.com> References: To: QEMU Developers X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-08_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=679 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1904080018 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 17.58.6.40 Subject: [Qemu-devel] [PATCH 2/2] ui/cocoa: Fix mouse grabbing in fullscreen mode for relative input device 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: , From: Chen Zhang via Qemu-devel Reply-To: Chen Zhang Cc: Peter Maydell , Gerd Hoffmann 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" In fullscreen mode, the window property of cocoaView may not be the key window, and the current implementation would not grab mouse in fullscreen mode after user ungrabs cursor in fullscreen mode with hot-key, and left clicks the relative input devices to re-grab it. This patch used value of isFullscreen as a short-cirtuit condition for relative input device grabbing. Signed-off-by: Chen Zhang --- ui/cocoa.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 474d44cb9f..aa7cf07368 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -901,7 +901,12 @@ QemuCocoaView *cocoaView; case NSEventTypeLeftMouseUp: mouse_event =3D true; if (!isMouseGrabbed && [self screenContainsPoint:p]) { - if([[self window] isKeyWindow]) { + /* + * In fullscreen mode, the window of cocoaView may not be = the + * key window, therefore the position relative to the virt= ual + * screen alone will be sufficient. + */ + if(isFullscreen || [[self window] isKeyWindow]) { [self grabMouse]; } } --=20 2.19.2