From patchwork Mon Jun 23 09:35:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 32343 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7AB2320540 for ; Mon, 23 Jun 2014 09:38:32 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id v10sf22949590pde.11 for ; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=Cj2ItA3vSarEH35zwWFYjhFq+zzPZ+LegGC9SJxcJ/s=; b=APGVrPr77XfcJISeuMSiv7IGx0/ogVzmQ9zgGFTdFAoPEhPAPZzmSNRljnYzkLcgnd 5V3Tnb16L1OgAOhiGOhT2GaxeaX88ikNhd3O04ViAT6SkIk2VZESaonzoDQhQXjAMSzB 7eWKt/2Fomk3L5w6eFEyYlpo/mT7OIa373NopUraC8DwYO2PEGYyDQFFw+zyBKhB9XBA 4f4SbDPVOUTA3490E9esBNOiUxbnyYzenTLPG/dNgHa6VDAAMswja+StXvbwPjt0Oac4 Cg92z1rpczuVDwBH8dkxuFmBTS6yshplooNmnpjWu6podNGV8XuJTTxOfU6n/xllGldD na0A== X-Gm-Message-State: ALoCoQnFlDmGDgJxYZiNpUYY3qdaisd7wm1JioNcH5HljasNkvccjs2ns2OBdFtHwkF0RbwURlHj X-Received: by 10.68.133.138 with SMTP id pc10mr9140439pbb.5.1403516311745; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.165 with SMTP id d34ls1868569qgd.25.gmail; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) X-Received: by 10.221.40.193 with SMTP id tr1mr5891084vcb.31.1403516311589; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id yi11si8658025vdb.1.2014.06.23.02.38.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 02:38:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hy10so5746596vcb.3 for ; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr18264502vco.25.1403516311509; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp117531vcb; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) X-Received: by 10.140.83.209 with SMTP id j75mr29018412qgd.42.1403516311187; Mon, 23 Jun 2014 02:38:31 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b4si13970127qae.77.2014.06.23.02.38.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Jun 2014 02:38:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:52347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz0hq-0002Ki-SR for patch@linaro.org; Mon, 23 Jun 2014 05:38:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz0f3-0006zu-LU for qemu-devel@nongnu.org; Mon, 23 Jun 2014 05:35:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz0f0-00062g-HX for qemu-devel@nongnu.org; Mon, 23 Jun 2014 05:35:37 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz0f0-00061e-3V for qemu-devel@nongnu.org; Mon, 23 Jun 2014 05:35:34 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Wz0er-0003ng-96; Mon, 23 Jun 2014 10:35:25 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 23 Jun 2014 10:35:25 +0100 Message-Id: <1403516125-14568-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1403516125-14568-1-git-send-email-peter.maydell@linaro.org> References: <1403516125-14568-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 4/4] ui/cocoa: Honour -show-cursor command line option 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Honour the -show-cursor command line option (which forces the mouse pointer to always be displayed even when input is grabbed) in the Cocoa UI backend. Signed-off-by: Peter Maydell --- ui/cocoa.m | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 06951d0..3147178 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -323,6 +323,22 @@ QemuCocoaView *cocoaView; return (p.x > -1 && p.x < screen.width && p.y > -1 && p.y < screen.height); } +- (void) hideCursor +{ + if (!cursor_hide) { + return; + } + [NSCursor hide]; +} + +- (void) unhideCursor +{ + if (!cursor_hide) { + return; + } + [NSCursor unhide]; +} + - (void) drawRect:(NSRect) rect { COCOA_DEBUG("QemuCocoaView: drawRect\n"); @@ -735,7 +751,7 @@ QemuCocoaView *cocoaView; else [normalWindow setTitle:@"QEMU - (Press ctrl + alt to release Mouse)"]; } - [NSCursor hide]; + [self hideCursor]; if (!isAbsoluteEnabled) { isMouseDeassociated = TRUE; CGAssociateMouseAndMouseCursorPosition(FALSE); @@ -753,7 +769,7 @@ QemuCocoaView *cocoaView; else [normalWindow setTitle:@"QEMU"]; } - [NSCursor unhide]; + [self unhideCursor]; if (isMouseDeassociated) { CGAssociateMouseAndMouseCursorPosition(TRUE); isMouseDeassociated = FALSE;