No window focus in Carbon app on 10.5
Hi
I have a command line app which uses AGL to create a window and context for rendering. In 10.5 everything pretty much works except for the window never gets focus (no mouse events passed, etc). I had this problem long ago and the solution was to create a simple resource file with menu info and Rez that into the binary. After doing this the app showed up in the Dock and generally acted like any other Carbon GUI.
10.5 deprecates some of my AGL code like AGLDrawable and I'm wondering if that has anything to do with this or if my issue is a larger Carbon one.
Thanks in advance.
I have a command line app which uses AGL to create a window and context for rendering. In 10.5 everything pretty much works except for the window never gets focus (no mouse events passed, etc). I had this problem long ago and the solution was to create a simple resource file with menu info and Rez that into the binary. After doing this the app showed up in the Dock and generally acted like any other Carbon GUI.
10.5 deprecates some of my AGL code like AGLDrawable and I'm wondering if that has anything to do with this or if my issue is a larger Carbon one.
Thanks in advance.
Code:
ProcessSerialNumber psn;
GetCurrentProcess(&psn);
TransformProcessType(&psn, kProcessTransformToForegroundApplication);has always been the right way to do this.
Carbon is on its way out, you might want to consider switching to Cocoa at your earliest convenience.
OneSadCookie Wrote:Code:
ProcessSerialNumber psn;
GetCurrentProcess(&psn);
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
has always been the right way to do this.
Carbon is on its way out, you might want to consider switching to Cocoa at your earliest convenience.
You rock!
That was indeed it, and I have used this code before, but my mind is going. Thanks for the amazing speed in your response.
I hear you about Carbon, but this is a 100k cross platform (OSX, Windows, Linux) code base and it would be a massive task to go Cocoa especially since I don't particularly care for it. Since all the app needs is one window and some keyboard and mouse events I would probably consider going back to GLUT before Cocoa. Apple are keeping GLUT right?

Thanks again for the help!
Cross-platform is scarcely reason to avoid Cocoa, and whatever random bias you have against it you should reevaluate 
If you're cross-platform with such small requirements, is there good reason you're not using SDL anyway?

If you're cross-platform with such small requirements, is there good reason you're not using SDL anyway?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Detecting window focus events | Coyote | 2 | 2,990 |
Oct 23, 2009 03:01 PM Last Post: Coyote |
|
| C commands in a Carbon window. | mikey | 4 | 2,698 |
May 8, 2009 12:17 PM Last Post: mikey |
|
| Window focus events in Cocoa | Jar445 | 2 | 4,390 |
Jan 18, 2009 06:02 PM Last Post: Jar445 |
|
| OpenGL and Carbon Controls in the same Window | Hasty | 1 | 2,681 |
Sep 1, 2006 10:19 PM Last Post: OneSadCookie |
|

