Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-27 Thread Andy Lee via Cocoa-dev
On Jun 24, 2020, at 5:23 AM, Gabriel Zachmann via Cocoa-dev 
 wrote:
> I tried to add this in -viewDidLoad in MasterWindowController:
> 
>[[[self view] window] makeKeyAndOrderFront: NULL];

Some questions that may or may not help:

- Are you sure the above line of code is being called?  (I would check with a 
NSLog rather than a breakpoint.  Using a breakpoint can cause the active 
application to change, which you may not want.  You want to see what's 
happening when your app launches without *affecting* what's happening.)
- Did you mean -windowDidLoad rather than -viewDidLoad?
- What is the application *supposed* to do when you type keystrokes?
- I saw the thread earlier where you moved some logic into 
applicationWillFinishLaunching:.  What if you add back 
applicationDidFinishLaunching: and move just the full-screen toggling code 
there (and keep the rest in applicationWillFinishLaunching:)?
- Are you sure your application is the active application when you're typing 
those keystrokes?  You can check this by adding applicationDidBecomeActive: and 
applicationDidResignActive: methods to the application delegate, and having 
them call NSLog.  I'm not sure offhand if makeKeyAndOrderFront: makes the 
application active.
- Does your window have an initialFirstResponder?  Not sure this would make a 
difference in your case, but might in some circumstances. The 
initialFirstResponder can be set in Interface Builder.

--Andy

___

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: Launching in fullscreen gives "Funk" sound sometimes

2020-06-27 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot for the hint. 

I have now managed to find the time to try it out, alas, it's not the other app 
either that creates the "Funk" sound.

Could it be that no app at all has the keyboard focus?

And how can I make sure that my app really has the focus?



Best regards, Gabriel


> 
> It’s possible that the “funk” sound is coming from the other app if it still 
> has keyboard focus. Try attaching to that instead and seeing if it hits 
> NSBeep.
> 
> Saagar Jha
> 
>> On Jun 25, 2020, at 02:09, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>> 
>> 
>>> 
>>> Set a symbolic breakpoint on NSBeep and see whether it?s your code that?s 
>>> calling it.
>>> 
>>> 
>> 
>> Thanks a lot for the hint!
>> 
>> I think I managed to do that (it's a bit tricky, since my app gets launched 
>> in fullscreen mode by some other app).
>> Alas, the debugger did not break at any time when I heard the "Funk" sound.
>> So, I guess, we can conclude that my app does not call NSBeep().
>> 
>> Maybe, the keyboard focus is still on some other app? 
>> and that's why I 'm hearing the "funk" sound, because I am typing a key that 
>> is meaningful for my app, but not for the other app.
>> 
>> Or could it be that my app still has some other (hidden) windows open, 
>> behind the fullscreen window, which somehow produce the "funk" sound?



smime.p7s
Description: S/MIME cryptographic signature
___

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: Launching in fullscreen gives "Funk" sound sometimes

2020-06-25 Thread Saagar Jha via Cocoa-dev
It’s possible that the “funk” sound is coming from the other app if it still 
has keyboard focus. Try attaching to that instead and seeing if it hits NSBeep.

Saagar Jha

> On Jun 25, 2020, at 02:09, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> 
>> 
>> Set a symbolic breakpoint on NSBeep and see whether it?s your code that?s 
>> calling it.
>> 
>> 
> 
> Thanks a lot for the hint!
> 
> I think I managed to do that (it's a bit tricky, since my app gets launched 
> in fullscreen mode by some other app).
> Alas, the debugger did not break at any time when I heard the "Funk" sound.
> So, I guess, we can conclude that my app does not call NSBeep().
> 
> Maybe, the keyboard focus is still on some other app? 
> and that's why I 'm hearing the "funk" sound, because I am typing a key that 
> is meaningful for my app, but not for the other app.
> 
> Or could it be that my app still has some other (hidden) windows open, behind 
> the fullscreen window, which somehow produce the "funk" sound?
> 
> 
> Best regards, Gabriel
> 
> 
> ___
> 
> 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/saagar%40saagarjha.com
> 
> This email sent to saa...@saagarjha.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: Launching in fullscreen gives "Funk" sound sometimes

2020-06-25 Thread Gabriel Zachmann via Cocoa-dev

> 
> Set a symbolic breakpoint on NSBeep and see whether it?s your code that?s 
> calling it.
> 
> 

Thanks a lot for the hint!

I think I managed to do that (it's a bit tricky, since my app gets launched in 
fullscreen mode by some other app).
Alas, the debugger did not break at any time when I heard the "Funk" sound.
So, I guess, we can conclude that my app does not call NSBeep().

Maybe, the keyboard focus is still on some other app? 
and that's why I 'm hearing the "funk" sound, because I am typing a key that is 
meaningful for my app, but not for the other app.

Or could it be that my app still has some other (hidden) windows open, behind 
the fullscreen window, which somehow produce the "funk" sound?


Best regards, Gabriel




smime.p7s
Description: S/MIME cryptographic signature
___

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: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Sandor Szatmari via Cocoa-dev
G,


> On Jun 24, 2020, at 12:57, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> 
>> 
>> 
>> Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s 
>> calling it.
>> 
> 
> Thanks, but how would I do that?
> I never use NSBeep in my code ..
The system is calling NSBeep
> 
> Best regards, Gabriel
> 
> 
> ___
> 
> 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/admin.szatmari.net%40gmail.com
> 
> This email sent to admin.szatmari@gmail.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: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Alex Zavatone via Cocoa-dev
Symbolic breakpoints, my man!



> On Jun 24, 2020, at 11:57 AM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
>> 
>> Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s 
>> calling it.
>> 
> 
> Thanks, but how would I do that?
> I never use NSBeep in my code ..
> 
> Best regards, Gabriel
> 
> 
> ___
> 
> 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/zav%40mac.com
> 
> This email sent to z...@mac.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: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Richard Charles via Cocoa-dev

> On Jun 24, 2020, at 10:57 AM, Gabriel Zachmann via Cocoa-dev wrote:
> 
>> 
>> Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s 
>> calling it.
>> 
> 
> Thanks, but how would I do that?
> I never use NSBeep in my code ..
> 
> Best regards, Gabriel


Symbolic Breakpoints

https://www.bignerdranch.com/blog/xcode-breakpoint-wizardry-for-debugging/


--Richard Charles

___

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: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Gabriel Zachmann via Cocoa-dev
> 
> Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s 
> calling it.
> 

Thanks, but how would I do that?
I never use NSBeep in my code ..

Best regards, Gabriel




smime.p7s
Description: S/MIME cryptographic signature
___

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: 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 code to switch to fullscreen at startup (in AppDelegate.m):
> 
> - (void) applicationWillFinishLaunching: (NSNotification *) notification
> {
>[self.window setFrameAutosaveName: @"de.zach.ArtSaverApp"];   // make 
> window "remember" its positions & size; do it before handling "-f"
> 
>bool startInFullScreen = NO;
> 
>// check flags ...
> 
>if ( startInFullScreen )
>[self.window toggleFullScreen: nil];  
> }
> 
> 
> The problem is that , sometimes, the app does not receive keystrokes.
> At least, I get the typical "Funk" sound when typing a key,
> just like what occurs sometimes in other apps, when the focus is somehow out 
> of sync.
> 
> The problem occurs only sometimes, but I could not find a pattern.
> (Maybe, it's got something to do with timing?)
> Should I put the switch to fullscreen mode somewhere else?
> 
> 
> I tried to add this in -viewDidLoad in MasterWindowController:
> 
>[[[self view] window] makeKeyAndOrderFront: NULL]; 
> 
> But it didn't help.
> 
> Of course, when the app launches normally, and does not call toggleFullScreen,
> then everything is fine with the keyboard focus.
> 
> 
> Any insights or ideas will be greatly appreciated.
> 
> Best regards, Gabriel
> 
> ___
> 
> 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/graham.cox%40bigpond.com
> 
> This email sent to graham@bigpond.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


Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Gabriel Zachmann via Cocoa-dev
I have an app that should switch to fullscreen automatically, 
if it is launched with a specific flag.

This is my code to switch to fullscreen at startup (in AppDelegate.m):

- (void) applicationWillFinishLaunching: (NSNotification *) notification
{
[self.window setFrameAutosaveName: @"de.zach.ArtSaverApp"];   // make 
window "remember" its positions & size; do it before handling "-f"

bool startInFullScreen = NO;

// check flags ...

if ( startInFullScreen )
[self.window toggleFullScreen: nil];  
}


The problem is that , sometimes, the app does not receive keystrokes.
At least, I get the typical "Funk" sound when typing a key,
just like what occurs sometimes in other apps, when the focus is somehow out of 
sync.

The problem occurs only sometimes, but I could not find a pattern.
(Maybe, it's got something to do with timing?)
Should I put the switch to fullscreen mode somewhere else?


I tried to add this in -viewDidLoad in MasterWindowController:

[[[self view] window] makeKeyAndOrderFront: NULL]; 

But it didn't help.

Of course, when the app launches normally, and does not call toggleFullScreen,
then everything is fine with the keyboard focus.


Any insights or ideas will be greatly appreciated.

Best regards, Gabriel



smime.p7s
Description: S/MIME cryptographic signature
___

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