Re: Context Menu and first responder targets

2023-03-05 Thread Graham Cox via Cocoa-dev
Hi Eyal, I believe the target for a pop-up menu is the view that you pass in that method, at least initially. If there is an established responder chain from that view to other responders (up to and including First Responder) then the menu items should reach their target. But it’s pretty easy t

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Graham Cox via Cocoa-dev
Then look at some of the other options in that API, e.g. IOPMAssertionDeclareUserActivity AFACS, this is the supported way to do the kinds of things you want, of it can be done at all. > On 29 Jun 2020, at 4:51 pm, Gabriel Zachmann wrote: > >> but the header for that function says it can be

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Graham Cox via Cocoa-dev
In the “old days”, your app could periodically call UpdateSystemActivity( UsrActivity ) to prevent the screensaver kicking in. This has been deprecated since 10.8, but the header for that function says it can be replaced by IOPMAssertionCreateWithName(). I haven’t looked at that in detail or use

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-27 Thread Graham Cox via Cocoa-dev
You can make your app trigger a command-line program and pass params using NSTask. It’s not difficult to use. But in this case you might want to negotiate this with the user - apps that just go ahead and change MY system preferences are being user-hostile to say the least. —Graham > On 28 Ju

Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Graham Cox via Cocoa-dev
Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s calling it. —Graham > On 24 Jun 2020, at 7:23 pm, Gabriel Zachmann via Cocoa-dev > wrote: > > I have an app that should switch to fullscreen automatically, > if it is launched with a specific flag. > > This is my co