Closed Bug 181042 Opened 22 years ago Closed 11 years ago

"dependent window created without a parent" from profile manager

Categories

(Core Graveyard :: Profile: BackEnd, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: bugzilla, Unassigned)

Details

starting a debug build of mozilla seems to produces and have produced this for 
the last 24+ months. Cant find bug about it, so here we go:

WARNING: dependent window created without a parent, file d:/moz_source/gmake/moz
illa/xpfe/bootstrap/nsWindowCreator.cpp, line 123
As the comment above it says, "so we allow it after some bellyaching." So,
what's the bug - do you want Dan to stop bellyaching? Unless Dan wants to get
rid of the assertion, it's a WONTFIX.
timeless just said: "usually it means someone is doing something evil"

I just thought that the printing of a warning means that that something is
wrong. Not in printing the comment but something that triggers the printing.
I think the idea here is that there's really no reason for the profile manager
to be a dependent window.  Or is that there to support live profile switching?

The warning (not assertion) should certainly stay no matter what.  It almost
always indicates a serious logic error (though it may not in this case; I don't
know the internals of the profile manager).
The window is modal. Any window that's modal is considered to be dependent by
window watcher. See
http://lxr.mozilla.org/seamonkey/source/embedding/components/windowwatcher/src/nsWindowWatcher.cpp#571.
Also, the window does not have a parent, nor should it. So, we end up with this
assertion. It's harmless.

I think (Dan, correct me if I'm wrong) that the assertion is there to discourage
people from throwing up app-modal windows all over the place. Again, the profile
mgr window is one which *should* be app-modal.
> *should* be app-modal

1)  Why?  Again, is this for profile switching?  If not, what's the point of being
    modal at startup when none of the rest of the app even exists yet?  Does it
    serve a useful function on the mac, maybe?
2)  Is there actually any guarantee that a modal window with no parent is
    app-modal?  I'm pretty sure that's not true on Linux.
It's modal because it has to be confirmed or dismissed before the code which
poses it can continue. And, no, it's not for profile switching - it's always
been that way.
Ah.  OK, that makes sense.  Perhaps you want to parent it to the hidden window
then?  (Not sure whether the hidden window exists by the time the profile
manager comes up.)  See eg the code at
http://lxr.mozilla.org/seamonkey/source/xpfe/components/filepicker/src/nsFilePicker.js#184
One of the reasons for windowwatcher is so that it's possible to open a dialog 
without the hidden window. I think that the hidden window is now deprecated. Ah,
now I remember: the hidden window does not exist in embedding environments, so
windowwatcher and windowcreator were made and the hidden window became deprecated.

Dan, settle this for us, please? 
You guys have sussed it out. Mozilla doesn't do application-modal windows
(unless the OS specifies that behaviour for modal windows). So modal windows are
bound to some parent window, which makes them dependent windows as well.

With the lone exception of the Profile Manager (to my knowledge), any code that
wants to pose a modal dialog/alert is running within the context of an operation
that belongs to some window. So some window wants to be shut down to user
interaction while the modal window is up, and it's important shut down the
correct one. But often the code responsible for the alert is buried at some
level that's lost its window context, so it specifies none.

The warning is there to help discourage people from programming modal windows
without a parent, because it's almost certainly an error and because it makes
the application misbehave. The Profile Manager is the only legitimate exception
that I know of. The dialog needs to be modal so execution will stop until it's
dismissed (comment 6) and it has no parent window, not even conceptually. So it
gets the warning intended for everyone else.

I'm leaving the bug open. For a fix I recommend putting a comment in the profile
manager code as a way of documenting that this behaviour is intentional and
worthy of a warning, but not a ticket.
Right.  I should have thought of embedding; sorry Conrad.  I would be quite
happy with a comment at the callsite explaining that we need to be modal to
block execution and there're no windows to be parented to.

Thanks, Dan and Conrad.
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1a2pre) Gecko/2008073018 SeaMonkey/2.0a1pre] (home made) (W2Ksp4)

{{
WARNING: dependent window created without a parent: file .../toolkit/components/startup/src/nsAppStartup.cpp, line 458
}}
Assignee: ccarlen → nobody
Severity: normal → minor
QA Contact: ktrina → profile-manager-backend
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090409 Minefield/3.6a1pre] (home, debug+options) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/cb053a66c9ed)

{
WARNING: dependent window created without a parent: file .../toolkit/components/startup/src/nsAppStartup.cpp, line 472
}
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.