Mac applicationDockMenu delegate method not called after process restart. Patch by Steven Michaud. r=josh r=bsmedberg

This commit is contained in:
joshmoz@gmail.com 2007-05-16 19:10:19 -07:00
parent 471819ac98
commit 014def332b
3 changed files with 14 additions and 2 deletions

View File

@ -42,6 +42,7 @@
#ifndef __MacApplicationDelegate_h__
#define __MacApplicationDelegate_h__
void EnsureUseCocoaDockAPI(void);
void SetupMacApplicationDelegate(void);
#endif

View File

@ -63,6 +63,14 @@
// Something to call from non-objective code.
// This is needed, on relaunch, to force the OS to use the "Cocoa Dock API"
// instead of the "Carbon Dock API". For more info see bmo bug 377166.
void
EnsureUseCocoaDockAPI()
{
[NSApplication sharedApplication];
}
void
SetupMacApplicationDelegate()
{

View File

@ -50,8 +50,6 @@
#ifdef XP_MACOSX
#include "MacLaunchHelper.h"
#endif
#ifdef MOZ_WIDGET_COCOA
#include "MacApplicationDelegate.h"
#endif
@ -2342,6 +2340,11 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
#ifdef XP_MACOSX
if (PR_GetEnv("MOZ_LAUNCHED_CHILD")) {
// This is needed, on relaunch, to force the OS to use the "Cocoa Dock
// API". Otherwise the call to ReceiveNextEvent() below will make it
// use the "Carbon Dock API". For more info see bmo bug 377166.
EnsureUseCocoaDockAPI();
// When the app relaunches, the original process exits. This causes
// the dock tile to stop bouncing, lose the "running" triangle, and
// if the tile does not permanently reside in the Dock, even disappear.