Window Size and Location

2015-04-24 Thread Raglan T. Tiger
Where are widow sizes and locations stored other than the app defaults ?  There 
must be some cache managed by OS X.

-rags




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

RE: Window Size and Location

2015-04-24 Thread Lee Ann Rucker
~/Library/Saved Application State

From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
[cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Raglan T. 
Tiger [r...@crusaderrabbit.net]
Sent: Friday, April 24, 2015 10:05 AM
To: Cocoa Dev
Subject: Window Size and Location

Where are widow sizes and locations stored other than the app defaults ?  There 
must be some cache managed by OS X.

-rags




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com

This email sent to lruc...@vmware.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Window Size and Location

2015-04-24 Thread Raglan T. Tiger

> On Apr 24, 2015, at 11:36 AM, Lee Ann Rucker  wrote:
> 
> ~/Library/Saved Application State

Can the application delete its .savedState file without any grumbling from OS X?

-rags
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

RE: Window Size and Location

2015-04-24 Thread Lee Ann Rucker
I've never tried doing it from an app (I have just deleted it from the finder 
for testing; it acts like a newly installed app with no saved prefs), but if 
it's window restoration you can just ignore it. If it's autosave, there's 
removeFrameUsingName

From: Raglan T. Tiger [r...@crusaderrabbit.net]
Sent: Friday, April 24, 2015 11:33 AM
To: Lee Ann Rucker
Cc: Cocoa Dev
Subject: Re: Window Size and Location

> On Apr 24, 2015, at 11:36 AM, Lee Ann Rucker  wrote:
>
> ~/Library/Saved Application State

Can the application delete its .savedState file without any grumbling from OS X?

-rags

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Try to open an app from a screensaver

2015-04-24 Thread Juanjo Conti
I'm developing a screensaver. I want to achieve the following: then the
user hits the key 's', stop the screensaver and open a program.

Handling the key stroke is done, and I'm launching the program as:

(the following code search runningApplications to see if the app is already
running, if not it's open with launchApplicationAtURL. Finally I take it to
foreground with activateWithOptions)

var app: NSRunningApplication?
for a in NSWorkspace.sharedWorkspace().*runningApplications*
as! [NSRunningApplication] {
if a.localizedName!.isEqual("App Name") {
app = a
break
}
}
if app == nil {
app =
NSWorkspace.sharedWorkspace().*launchApplicationAtURL*(NSURL(fileURLWithPath:
UsualApplicationPath)!, options: NSWorkspaceLaunchOptions.Default,
configuration: [:], error: nil)!
}
var foreground = false
while !foreground {
foreground = app!.*activateWithOptions*
(NSApplicationActivationOptions.ActivateIgnoringOtherApps)
}

After that i raise the event that finish the screensaver.

The problem is that sometimes, if there is a Finder window open, my app
ends at the bottom of it (!) Anybody knows why can this be happening?

-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Try to open an app from a screensaver

2015-04-24 Thread Juanjo Conti
In the console appears messages of this type:

24/4/15 21:37:54,345 launchservicesd[80]: Application App:"Screensaver
Ninja" asn:0x0-a4ba4b pid:60486 refs=7 @ 0x7f859d3cd4d0 tried to be brought
forward, but isn't in fPermittedFrontApps ( ( "LSApplication:0x0-0x1001
pid=94 "loginwindow"", "LSApplication:0x0-0xa4fa4f pid=60505
"ScreenSaverEngine"")), so denying. : LASSession.cp #1521
SetFrontApplication() q=LSSession 16/0x186a6 queue
24/4/15 21:37:54,346 WindowServer[159]: [cps/setfront] Failed setting the
front application to Screensaver Ninja, psn 0x0-0xa4ba4b,
securitySessionID=0x186a6, err=-13066


On Fri, Apr 24, 2015 at 7:40 PM, Juanjo Conti 
wrote:

> I'm developing a screensaver. I want to achieve the following: then the
> user hits the key 's', stop the screensaver and open a program.
>
> Handling the key stroke is done, and I'm launching the program as:
>
> (the following code search runningApplications to see if the app is
> already running, if not it's open with launchApplicationAtURL. Finally I
> take it to foreground with activateWithOptions)
>
> var app: NSRunningApplication?
> for a in NSWorkspace.sharedWorkspace().*runningApplications*
> as! [NSRunningApplication] {
> if a.localizedName!.isEqual("App Name") {
> app = a
> break
> }
> }
> if app == nil {
> app = NSWorkspace.sharedWorkspace().
> *launchApplicationAtURL*(NSURL(fileURLWithPath: UsualApplicationPath)!,
> options: NSWorkspaceLaunchOptions.Default, configuration: [:], error: nil)!
> }
> var foreground = false
> while !foreground {
> foreground = app!.*activateWithOptions*
> (NSApplicationActivationOptions.ActivateIgnoringOtherApps)
> }
>
> After that i raise the event that finish the screensaver.
>
> The problem is that sometimes, if there is a Finder window open, my app
> ends at the bottom of it (!) Anybody knows why can this be happening?
>
> --
>
> Juanjo Conti http://goog_2023646312>@carouselapps.com
> >
>
> Software Engineer - Carousel Apps 
>
>


-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Try to open an app from a screensaver

2015-04-24 Thread Graham Cox

> On 25 Apr 2015, at 8:40 am, Juanjo Conti  wrote:
> 
> I'm developing a screensaver. I want to achieve the following: then the
> user hits the key 's', stop the screensaver and open a program.


Don’t know, but also consider what happens if the user has “require password 
when leaving screensaver” set. That’s going to make for an “interesting” user 
experience to say the least.

—Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Try to open an app from a screensaver

2015-04-24 Thread Juanjo Conti
That case works ok if there are no Finder windows around.

On Fri, Apr 24, 2015 at 9:46 PM, Graham Cox  wrote:

>
> > On 25 Apr 2015, at 8:40 am, Juanjo Conti 
> wrote:
> >
> > I'm developing a screensaver. I want to achieve the following: then the
> > user hits the key 's', stop the screensaver and open a program.
>
>
> Don’t know, but also consider what happens if the user has “require
> password when leaving screensaver” set. That’s going to make for an
> “interesting” user experience to say the least.
>
> —Graham
>
>
>


-- 

Juanjo Conti http://goog_2023646312>@carouselapps.com
>

Software Engineer - Carousel Apps 

-- 
Carousel Apps Limited, registered in England & Wales with registered number 
7689440 and registered office Unit 2 Artbrand Studios, 7 Leathermarket 
Street, London SE1 3HN. Any communication sent by or on behalf of Carousel 
App Ltd or any of its subsidiary, holding or affiliated companies or 
entities (together "Watu") is confidential and may be privileged or 
otherwise protected. If you receive it in error please inform us and then 
delete it from your system. You should not copy it or disclose its contents 
to anyone. Messages sent to and from Watu may be monitored to ensure 
compliance with our internal policies and to protect our business. Emails 
are not secure and cannot be guaranteed to be error free. Anyone who 
communicates with us by email is taken to accept these risks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com