Launch mozilla from command line does not get the focus

Héctor Rivas Gándara <[email protected]> Mon, 18 Apr 2005 11:49:56 +0200
Newsgroups gmane.comp.mozilla.devel.macosx
Message-ID <[email protected]>
Hi,

I'm a newbie in macos world, comming from linux.

I've build a debug version of mozilla. If I try to launch it from 
commad line, the windows appears, but dows not get the focus. I can't 
use it, it does not receive events, and I have to close it. But if I 
launch it from Finder usen the .app bundle, it works.

How can I do it work? what is happening?

The same happens if I try to launch a xul window using xpcshell with 
this script:

---
var EventQClass =
Components.classes['@mozilla.org/event-queue-service;1'];

var EventQObj =  
EventQClass.getService(Components.interfaces.nsIEventQueueService);

EventQObj.createThreadEventQueue();

var AppShellClass =
Components.classes['@mozilla.org/appshell/appShellService;1'];
var AppShellObj =
AppShellClass.getService(Components.interfaces.nsIAppShellService);

var URLClass =  
Components.classes['@mozilla.org/network/standard-url;1'];
var URLObj = URLClass.createInstance(Components.interfaces.nsIURL);

URLObj.spec="file:///tmp/test.xul";

AppShellObj.initialize(null,null);

var test = new Object();
toto = AppShellObj.createTopLevelWindow(null,URLObj,
  true,true,
  Components.interfaces.nsIWebBrowserChrome.CHROME_ALL,
  640,480,test);

AppShellObj.run();
---

Launch a xul window from xpcshell has special interest for debug 
propouses.

--
Greets
Keymon