venj / theunarchiver

Automatically exported from code.google.com/p/theunarchiver
Other
0 stars 0 forks source link

When the application starts, does not go in foregroung correctly #246

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When the application starts, it opens automatically the preferences window and 
makes it active.
But the application's main menu is not visible and the last application used's 
menu is visualized.
If we move to another application and then again to The Unarchiver, the menu 
becomes visible 
correctly.
Looking at the code I see that when the application starts, it calls the method 
delayedAfterLaunch where transforms the process from background to foreground 
using 
TransformProcessType function.
Then activates the application and makes the key window with 
activateIgnoringOtherApps: and 
makeKeyAndOrderFront methods.
But in the documentation of the TransformProcessType function Apple says:
"This function does not cause the application to be brought to the front; you 
must call 
SetFrontProcess to do so."
So, it is possible that calling this function the app would go to foreground 
correctly?

P.S. Sorry for my bad English.

Original issue reported on code.google.com by mac.marc...@gmail.com on 13 Apr 2010 at 3:12

GoogleCodeExporter commented 9 years ago
Turns out this is some kind of OS X bug introduced in Leopard, and 
SetFrontProcess doesn't help either.

I finally found a workaround after googling around, though: Switch to another 
process (the dock) and then 
immediately switch back, and the menubar will finally appear!

So, fixed.

Original comment by paracel...@gmail.com on 4 May 2010 at 1:05