Last Comment Bug 317811 - Allow single-window-instance XULRunner applications
: Allow single-window-instance XULRunner applications
: fixed1.8.1
Product: Toolkit Graveyard
Classification: Graveyard
Component: XULRunner (show other bugs)
: unspecified
: All All
-- enhancement (vote)
: mozilla1.9alpha1
Assigned To: Alex Sirota (iosart)
Depends on:
  Show dependency treegraph
Reported: 2005-11-25 17:00 PST by Alex Sirota (iosart)
Modified: 2016-02-12 08:12 PST (History)
7 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

Support singleton-window applications (1.13 KB, patch)
2005-11-25 17:04 PST, Alex Sirota (iosart)
benjamin: first‑review+
darin.moz: approval1.8.1+
Details | Diff | Splinter Review

Description User image Alex Sirota (iosart) 2005-11-25 17:00:21 PST
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)
Comment 1 User image Alex Sirota (iosart) 2005-11-25 17:04:05 PST
Created attachment 204186 [details] [diff] [review]
Support singleton-window applications

Ben, I hope haven't missed a simpler way of doing this
Comment 2 User image Benjamin Smedberg [:bsmedberg] 2005-11-29 11:32:22 PST
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.
Comment 3 User image Alex Sirota (iosart) 2005-12-01 01:44:04 PST
Added the article:
Comment 4 User image :Gavin Sharp [email:] 2006-02-04 12:02:57 PST
Should this be checked in?
Comment 5 User image Benjamin Smedberg [:bsmedberg] 2006-02-05 04:49:53 PST
Looks like it, yes.
Comment 6 User image :Gavin Sharp [email:] 2006-02-05 06:59:20 PST
mozilla/toolkit/components/nsDefaultCLH.js; new revision: 1.6;
Comment 7 User image Bruneux 2006-03-02 07:50:58 PST
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).
Comment 8 User image Benjamin Smedberg [:bsmedberg] 2006-03-02 07:56:39 PST
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.
Comment 9 User image gbond 2006-06-28 09:08:56 PDT
Should this FIX have appeared in ?
I've been using the code in the attachment since and I have to keep re-applying it after every release...
Comment 10 User image Ben Turner (not reading bugmail, use the needinfo flag!) 2006-06-28 09:13:27 PDT
(In reply to comment #9)
> Should this FIX have appeared in ?
> I've been using the code in the attachment since 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 11 User image Benjamin Smedberg [:bsmedberg] 2006-06-28 09:41:23 PDT
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
Comment 12 User image :Gavin Sharp [email:] 2006-07-19 18:20:27 PDT

Note You need to log in before you can comment on or make changes to this bug.