XULRunner makes sure that there is only one xulrunner process running per application (when MOZ_NO_REMOTE is not set). While there is indeed only one process per appliction, each new invokation will open a new application main window. This patch adds support for making sure that only one application window is opened. Add the following line to the application prefs file: pref("toolkit.singletonWindowType", "xulmine"); meaning that when one xulmine is already running, invoking it one more time won't open a new xulmine window, but will raise the first one. (*) This only partially solves the problem, because if the second window is trying to open while the first one is still opening, both will be opened (two invokations in quick succession)
Created attachment 204186 [details] [diff] [review] Support singleton-window applications Ben, I hope haven't missed a simpler way of doing this
Comment on attachment 204186 [details] [diff] [review] Support singleton-window applications Looks good to me. Please write up something on devmo explaining how this works.
Should this be checked in?
Looks like it, yes.
mozilla/toolkit/components/nsDefaultCLH.js; new revision: 1.6;
It doesn't seem to handle the case that when you want to pass new parameters to the existing window (e.g. if you want to replace the content of the opened window).
Bruneux, if you want complex functionality you're going to have to write your own command line handler: you would have to fire some kind of event at the window that new data was available (and make that data available), unless you knew what functions were available on the window itself.
Should this FIX have appeared in 220.127.116.11/5 ? I've been using the code in the attachment since 18.104.22.168 and I have to keep re-applying it after every release...
(In reply to comment #9) > Should this FIX have appeared in 22.214.171.124/5 ? > I've been using the code in the attachment since 126.96.36.199 and I have to keep > re-applying it after every release... > This was only checked into the trunk, not 1.8... Do we want this for 1.8?
Comment on attachment 204186 [details] [diff] [review] Support singleton-window applications Not going to take this for 1.8.0.x, but I wouldn't mind taking it for 1.8