No window focus in Carbon app on 10.5

withnail
Unregistered
 
Post: #1
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
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.
Quote this message in a reply
withnail
Unregistered
 
Post: #3
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? Smile

Thanks again for the help!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Cross-platform is scarcely reason to avoid Cocoa, and whatever random bias you have against it you should reevaluate Rasp

If you're cross-platform with such small requirements, is there good reason you're not using SDL anyway?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Detecting window focus events Coyote 2 3,414 Oct 23, 2009 03:01 PM
Last Post: Coyote
  C commands in a Carbon window. mikey 4 3,143 May 8, 2009 12:17 PM
Last Post: mikey
  Window focus events in Cocoa Jar445 2 5,382 Jan 18, 2009 06:02 PM
Last Post: Jar445
  OpenGL and Carbon Controls in the same Window Hasty 1 3,061 Sep 1, 2006 10:19 PM
Last Post: OneSadCookie