Closed
Bug 310076
Opened 19 years ago
Closed 19 years ago
calling app restart from nsBrowserGlue causes failure to restart the app properly
Categories
(Toolkit :: Startup and Profile System, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: mconnor, Assigned: benjamin)
References
()
Details
(Keywords: fixed1.8)
Attachments
(3 files, 1 obsolete file)
6.10 KB,
patch
|
darin.moz
:
first-review+
|
Details | Diff | Splinter Review |
21.63 KB,
patch
|
darin.moz
:
first-review+
|
Details | Diff | Splinter Review |
6.47 KB,
patch
|
asa
:
approval1.8b5+
|
Details | Diff | Splinter Review |
restart is called, dialog closes, browser window opens. Once that window is
closed, app restarts. Benjamin says he can fix this today.
Comment 1•19 years ago
|
||
When I was testing this, I was launching a modal dialog from nsBrowserGlue's
_onProfileStartup ("profile-after-change" observer) and upon dismissal of the
dialog the app would restart (which brought up the dialog again, etc). This only
happened if I caused a startup restart by using my profile in another build
(which I think is another bug). I guess this is because the EM and browserglue
try to do things at the same time?
Assignee | ||
Comment 2•19 years ago
|
||
This will skip the event loop on nsIAppStartup.run if we've already called
.quit relatively successfully.
Attachment #197576 -
Flags: first-review?(darin)
Assignee | ||
Comment 3•19 years ago
|
||
This patch is more involved than the first in that it uses the
considerquitstopper to determine when we should run the event loop and when to
try to exit, instead of merely checking for XUL window open/close. This is
something I've been wanting to do, and is necessary to fix bug 281847 properly.
This is not really branch material, so I'm going to look for a temporary hack
for the branch for that bug.
Attachment #197747 -
Flags: first-review?(darin)
Assignee | ||
Comment 4•19 years ago
|
||
Comment on attachment 197747 [details] [diff] [review]
More involved patch that uses considerquitstopper to control when to run the eventloop
Needs another little bit. Please note that the review request on the first
patch (targeted at the branch) is still valid.
Attachment #197747 -
Attachment is obsolete: true
Attachment #197747 -
Flags: first-review?(darin)
Assignee | ||
Comment 5•19 years ago
|
||
The additional change here involves making sure that the hidden window does not
affect consider-quit stoppage.
Assignee | ||
Updated•19 years ago
|
Attachment #197848 -
Flags: first-review?(darin)
Assignee | ||
Comment 6•19 years ago
|
||
Please ignore the NS_ERROR()s I added for debugging, I will remove them before
checkin.
Comment 7•19 years ago
|
||
Comment on attachment 197576 [details] [diff] [review]
Skip nsIAppStartup.run if we've already called .quit
>Index: toolkit/components/startup/src/nsAppStartup.cpp
>+ nsCOMPtr<nsIEventQueueService> svc = do_GetService(NS_EVENTQUEUESERVICE_CONTRACTID, &rv);
> if (NS_SUCCEEDED(rv)) {
>
>+ nsCOMPtr<nsIEventQueue> queue;
>+ rv = svc->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(queue));
>+ if (NS_SUCCEEDED(rv)) {
>
While your here, you might want to replace this code with just:
nsCOMPtr<nsIEventQueue> queue;
rv = NS_GetMainEventQ(getter_AddRefs(queue));
You'll need to #include "nsEventQueueUtils.h"
r=darin
Attachment #197576 -
Flags: first-review?(darin) → first-review+
Assignee | ||
Comment 8•19 years ago
|
||
Attachment #197900 -
Flags: approval1.8b5?
Assignee | ||
Comment 9•19 years ago
|
||
Attachment 197900 [details] [diff] checked in on trunk. I'm going to leave this open for the more
extensive considerquitstopper patch.
Updated•19 years ago
|
Attachment #197900 -
Flags: approval1.8b5? → approval1.8b5+
Assignee | ||
Comment 10•19 years ago
|
||
The simple change was committed this morning on the branch.
Keywords: fixed1.8
Comment 11•19 years ago
|
||
Comment on attachment 197848 [details] [diff] [review]
More involved patch that uses considerquitstopper to control when to run the eventloop, rev. 2
r=darin w/ NS_GetCurrentEventQ.
Attachment #197848 -
Flags: first-review?(darin) → first-review+
Assignee | ||
Comment 12•19 years ago
|
||
Fixed on trunk.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 13•19 years ago
|
||
Benjamin:
Please check if the trunk patch caused bug 311234 (Clicking 'Done' after
customize toolbars exits Firefox/Sunbird trunk builds).
Comment 14•19 years ago
|
||
The trunk version of this patch caused bug 312135 in Thunderbird - it seems to count "xul-window-registered" and "xul-window-destroyed" notifications, and only quits when they match. The problem is that Thunderbird (and SM, afaik) caches a compose window, because bringing up a compose window was (and most likely still is) slow. Thus, if you bring up a compose window, the count never goes to zero.
There might be some way for Thunderbird to detect when the last open window is closed, and in that case, close the cached compose window. But, is there a chance the nsAppStartup code could use some other mechanism that keeps track of open windows?
Assignee | ||
Comment 15•19 years ago
|
||
Let's discuss in bug 312135.
Component: XRE Startup → Startup and Profile System
QA Contact: nobody → startup
You need to log in
before you can comment on or make changes to this bug.
Description
•