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)
Ben, I hope haven't missed a simpler way of doing this
Attachment #204186 - Flags: first-review?(benjamin)
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.
Attachment #204186 - Flags: first-review?(benjamin) → first-review+
Should this be checked in?
Whiteboard: Needs-checkin → [checkin needed?]
Looks like it, yes.
Assignee: nobody → alex
Whiteboard: [checkin needed?] → [checkin needed]
mozilla/toolkit/components/nsDefaultCLH.js; new revision: 1.6;
Status: NEW → RESOLVED
Closed: 14 years ago
OS: Windows XP → All
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha1
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 184.108.40.206/5 ? I've been using the code in the attachment since 220.127.116.11 and I have to keep re-applying it after every release...
(In reply to comment #9) > Should this FIX have appeared in 18.104.22.168/5 ? > I've been using the code in the attachment since 22.214.171.124 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
Attachment #204186 - Flags: approval1.8.1?
You need to log in before you can comment on or make changes to this bug.