From patchwork Sat Apr 2 16:56:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 8732091 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64886C0553 for ; Sat, 2 Apr 2016 16:56:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC35A202DD for ; Sat, 2 Apr 2016 16:56:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 000932021F for ; Sat, 2 Apr 2016 16:56:15 +0000 (UTC) Received: from localhost ([::1]:50302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amOqN-0000LF-32 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 02 Apr 2016 12:56:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amOqG-0000Ku-C7 for qemu-devel@nongnu.org; Sat, 02 Apr 2016 12:56:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amOqD-00025B-6Q for qemu-devel@nongnu.org; Sat, 02 Apr 2016 12:56:08 -0400 Received: from mail-ig0-x235.google.com ([2607:f8b0:4001:c05::235]:37351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amOqC-000257-W6 for qemu-devel@nongnu.org; Sat, 02 Apr 2016 12:56:05 -0400 Received: by mail-ig0-x235.google.com with SMTP id l20so25722957igf.0 for ; Sat, 02 Apr 2016 09:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:subject:date:message-id:cc:to :mime-version; bh=HzwSJYRpDcrfWlO2daLZpPc12r2yivT3Z/UcTn4nZvk=; b=PMoLfAXRZPdbRFptDFL6nKUch1a6AJejakHWJ/LtUj9u4x45OSu1RYdzCYyKZiaIC+ M33L4uIU/nZPPDEj8NQMSaWXIqn/L/Yn0gKNEJbZGXyuRQtDoE6+oNX1hNB+bwFfi+cR /W+PYe1/Hnqo7IUMb1pzN51c1sSJ/AIrwITJRU7RlPvhVCd09e7ZCNx7N+Jk4Gs5nXl0 vrtCj25q3vu7yrhb8Jvvf5A4dJ6aIv8WDKzdXKdfy7Z/ZYd/8ALGDEkW2A4gRZYrScYw gOItYH9kpB0lyPS+KcLD0NWR0nur8rsuqAq5ii3hC3Hqi9skEY8Oe0wLQM8QT9r6J7+a Cvhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject:date :message-id:cc:to:mime-version; bh=HzwSJYRpDcrfWlO2daLZpPc12r2yivT3Z/UcTn4nZvk=; b=DxcKaPzlLrgH2qn3LJi0qGSqpKOKgK7Q1qkgCx86p6tYJjXXcAaln4Ppqmt9dZGBzD P3lae2Res2Gm3Sp0Y8XnKfDCaXYv0vX1dfFYpvB+RP2wAkHK/oTH3/OhKYmj/KT/7fOp u1bt1kpak8gfgN+arixTGQvCpeH3lUM6kyXu2/YsLkFOLEQtEmLDvQYS8GYXSBwAD7DZ Ip5EHpvlFSCcvzELBBsh/XFaIZltnyMGw3rqhaBFcKmya7kLIZ1p1RpcBfKCabIKASbw tB5fu2ZAtUA5PedU/MyILYN9PYMxls/GtAonR68Hlpad3D0mDWTVDoYHMpsmWQtgcHiH 1jrA== X-Gm-Message-State: AD7BkJIgZA9AsMXUL8GefogoG7uuNkaxKsr6bCTfkUYgEmXNwaGjYAG2Xy+K5u8JSrZGNA== X-Received: by 10.107.11.15 with SMTP id v15mr11372529ioi.184.1459616164124; Sat, 02 Apr 2016 09:56:04 -0700 (PDT) Received: from [192.168.0.5] (d199-74-164-53.col.wideopenwest.com. [74.199.53.164]) by smtp.gmail.com with ESMTPSA id o8sm1885523igv.18.2016.04.02.09.56.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Apr 2016 09:56:03 -0700 (PDT) From: Programmingkid Date: Sat, 2 Apr 2016 12:56:02 -0400 Message-Id: <864865FE-CA14-4D3A-8B73-84A2E321CA6C@gmail.com> To: Peter Maydell Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c05::235 Cc: qemu-devel qemu-devel Subject: [Qemu-devel] [PATCH] ui/cocoa.m: fix sending mouse event to guest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The mouse down event should not be sent to the guest if the mouse down event causes an activation of QEMU. This patch prevents activation clicks from going to the guest. Signed-off-by: John Arbuckle --- ui/cocoa.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 60a7c07..07d9c86 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -698,7 +698,7 @@ QemuCocoaView *cocoaView; * call below. We definitely don't want to pass that click through * to the guest. */ - if ((isMouseGrabbed || [[self window] isKeyWindow]) && + if ((isMouseGrabbed && [[self window] isKeyWindow]) && (last_buttons != buttons)) { static uint32_t bmap[INPUT_BUTTON__MAX] = { [INPUT_BUTTON_LEFT] = MOUSE_EVENT_LBUTTON,