From patchwork Mon Apr 22 20:29:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 16329 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EA2D823919 for ; Mon, 22 Apr 2013 20:30:51 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 1sf14186633qee.7 for ; Mon, 22 Apr 2013 13:30:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=o77FfzXHMNI8u8O5qCK/Cz+dqS1LuQIHnaWivC+VBH4=; b=NV2+/RdWJh8o1c7rKPL+0AesiILemirdOS77jkJAciFua8dHle1wHS23jKkQQU8mh/ 6y7BNzWPJbUxmoZ4sBI/YnvXGjPzwHccipP34yvaOcZLTWBodLQuPzTIslQKhKvX8a53 ZsPlOaCqyiNQoIiXBCQXnWamlFTyRZAN8jCBeKe3kmC7tp3rpslnHggfNLJNpjbu1z68 EqplhwB4yfouzODQrDKKRvU4+l2wSLZjdhcHq/gT19PA9O6TAGM6wfl/YsleljoZL5Sx W7eoApFExjrc9Dlg3vQ+xvwGxuJo3TJpQiaPw6dZ31eXNyHCHI/Nb4NS8GX5wXTDfy8a oCCw== X-Received: by 10.236.170.7 with SMTP id o7mr13717667yhl.1.1366662604708; Mon, 22 Apr 2013 13:30:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.193 with SMTP id i1ls6682qes.49.gmail; Mon, 22 Apr 2013 13:30:04 -0700 (PDT) X-Received: by 10.52.97.8 with SMTP id dw8mr17446230vdb.91.1366662604529; Mon, 22 Apr 2013 13:30:04 -0700 (PDT) Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [2607:f8b0:400c:c02::233]) by mx.google.com with ESMTPS id mo2si16782144vec.31.2013.04.22.13.30.04 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 13:30:04 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::233 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::233; Received: by mail-vb0-f51.google.com with SMTP id x19so6175841vbf.24 for ; Mon, 22 Apr 2013 13:30:04 -0700 (PDT) X-Received: by 10.58.173.36 with SMTP id bh4mr6330457vec.9.1366662604413; Mon, 22 Apr 2013 13:30:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp93411veb; Mon, 22 Apr 2013 13:30:03 -0700 (PDT) X-Received: by 10.180.108.3 with SMTP id hg3mr5451909wib.17.1366662594393; Mon, 22 Apr 2013 13:29:54 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id mb1si9709110wjb.238.2013.04.22.13.29.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Apr 2013 13:29:54 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UUNMz-0004lu-A9; Mon, 22 Apr 2013 21:29:49 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori Subject: [PATCH v3 2/4] ui/cocoa.m: Avoid deprecated CPS* functions Date: Mon, 22 Apr 2013 21:29:47 +0100 Message-Id: <1366662589-18315-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1366662589-18315-1-git-send-email-peter.maydell@linaro.org> References: <1366662589-18315-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQnAjLImQyJfc0JUSzdtw07DtYK8Ho6/HZ7ZeMeSLrkwQb5JAW511HTB7hhXCZ7PLhIT3Bv2 X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::233 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The functions CPSGetCurrentProcess and CPSEnableForegroundOperation are deprecated in newer versions of MacOSX and cause warning messages to be logged to the system log. Instead, use the new preferred method of promoting our console process up to a graphical app with menubar and Dock icon, which is TransformProcessType. (This function came in with MacOSX 10.3, so there's no need to retain the old method as we don't support anything earlier than 10.3 anyway.) Signed-off-by: Peter Maydell --- ui/cocoa.m | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 833c6ed..e3e1204 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -851,22 +851,10 @@ QemuCocoaView *cocoaView; -// Dock Connection -typedef struct CPSProcessSerNum -{ - UInt32 lo; - UInt32 hi; -} CPSProcessSerNum; - -OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); - int main (int argc, const char * argv[]) { gArgc = argc; gArgv = (char **)argv; - CPSProcessSerNum PSN; int i; /* In case we don't need to display a window, let's not do that */ @@ -890,12 +878,13 @@ int main (int argc, const char * argv[]) { } NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - [NSApplication sharedApplication]; - if (!CPSGetCurrentProcess(&PSN)) - if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) - if (!CPSSetFrontProcess(&PSN)) - [NSApplication sharedApplication]; + // Pull this console process up to being a fully-fledged graphical + // app with a menubar and Dock icon + ProcessSerialNumber psn = { 0, kCurrentProcess }; + TransformProcessType(&psn, kProcessTransformToForegroundApplication); + + [NSApplication sharedApplication]; // Add menus NSMenu *menu;