Allow single-window-instance XULRunner applications

RESOLVED FIXED in mozilla1.9alpha1

Status

Toolkit Graveyard
XULRunner
--
enhancement
RESOLVED FIXED
12 years ago
2 years ago

People

(Reporter: Alex Sirota (iosart), Assigned: Alex Sirota (iosart))

Tracking

({fixed1.8.1})

unspecified
mozilla1.9alpha1
fixed1.8.1

Details

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
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)
(Assignee)

Comment 1

12 years ago
Created attachment 204186 [details] [diff] [review]
Support singleton-window applications

Ben, I hope haven't missed a simpler way of doing this
Attachment #204186 - Flags: first-review?(benjamin)

Comment 2

12 years ago
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+
(Assignee)

Comment 3

12 years ago
Added the article:
http://developer.mozilla.org/en/docs/XULRunner:Specifying_Startup_Chrome_Window

Updated

12 years ago
Whiteboard: Needs-checkin
Should this be checked in?
Whiteboard: Needs-checkin → [checkin needed?]

Comment 5

12 years ago
Looks like it, yes.
Assignee: nobody → alex
Whiteboard: [checkin needed?] → [checkin needed]
mozilla/toolkit/components/nsDefaultCLH.js; new revision: 1.6;
Status: NEW → RESOLVED
Last Resolved: 12 years ago
OS: Windows XP → All
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha1

Comment 7

12 years ago
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

12 years ago
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

11 years ago
Should this FIX have appeared in 1.8.0.4/5 ?
I've been using the code in the attachment since 1.8.0.1 and I have to keep re-applying it after every release...
(In reply to comment #9)
> Should this FIX have appeared in 1.8.0.4/5 ?
> I've been using the code in the attachment since 1.8.0.1 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

11 years ago
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?

Updated

11 years ago
Attachment #204186 - Flags: approval1.8.1? → approval1.8.1+
mozilla/toolkit/components/nsDefaultCLH.js 	1.5.8.1
Keywords: fixed1.8.1
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.