Closed
Bug 92750
Opened 23 years ago
Closed 23 years ago
After modifying a new composer document, quitting the app doesn't ask to save changes
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
VERIFIED
FIXED
mozilla0.9.5
People
(Reporter: chrispetersen, Assigned: ccarlen)
References
Details
(Keywords: dataloss, Whiteboard: ETA 09/27, [PDT+], OSX, FIXED ON BRANCH)
Attachments
(1 file, 3 obsolete files)
11.74 KB,
patch
|
Brade
:
review+
sfraser_bugs
:
superreview+
|
Details | Diff | Splinter Review |
Build: 2001072905
Platform: Mac OS X
Expected Results: Save as dialog should appear
What I got: Application quits without prompting to save
Steps to reproduce:
1) Launch Mozilla.
2) Select Composer from the Tasks menu.
3) In the new document, type some text.
4) Press Command-Q to quit.
Reporter | ||
Comment 1•23 years ago
|
||
Appears to be Mac OS X only issue since I can't reproduce under Mac OS 9.1.
Comment 2•23 years ago
|
||
giving this to Simon since it is Mac and cc brade
Assignee: beppe → sfraser
Priority: -- → P3
Target Milestone: --- → mozilla0.9.4
Comment 3•23 years ago
|
||
What's up here guys?
Comment 4•23 years ago
|
||
Here's what I think is happening here.
Command-Q is picked up by the Mac OS X menu, not our File menu. Someone probably
hooked that up to call appShellService::Quit(), which closes all open windows.
However, this code path bypasses all the 'dirty window' logic that lives in the
JS.
I think a similar thing would happen if you sent Mozilla a 'quit' Apple Event.
So, the real issue is that there are ways into the Quit code path that bypass the
dirty window check logic. Since that lives in JS, we need something we can call
from C++ that can call that JS logic. Or we move that logic into C++. I think the
correct way to handle this would be to have quitting happen via a cmd_quit
command, and have a way to execute this command from C++.
This is not my bug.
Assignee: sfraser → danm
Comment 5•23 years ago
|
||
actually on osx, the quit menu item in the app menu sends a 'quit' apple event,
IIRC.
Updated•23 years ago
|
Target Milestone: mozilla0.9.4 → mozilla0.9.5
Reporter | ||
Comment 6•23 years ago
|
||
*** Bug 100647 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 7•23 years ago
|
||
Assignee | ||
Comment 8•23 years ago
|
||
Something I did for something else and haven't put to use yet: One way to make
JS callable from C++ is to wrap it in a little JS component. Then, from JS or
C++ it's equally easy to just create an instance and call its 1 method. Really I
just wanted to make a JS component but it could be useful.
Comment 9•23 years ago
|
||
This is data loss. We need to consider it for the branch.
Comment 10•23 years ago
|
||
This bug also bites on Mac OS 9. If you shut down your computer with an open
modified composer window (or mail composer) up, we'll quit without prompting you
to save it. The reason is the same -- going through the Quit Apple Event code
doesn't do the dirty window stuff.
Assignee | ||
Comment 11•23 years ago
|
||
So, is the JS component approach reasonable? If so, it's pretty easy to hook up.
Comment 12•23 years ago
|
||
Yes, please, if you have it ready to go. I believe that this bug will evaporate
if I fix bug 84256, and that's the general solution I still want to try. I won't
have it ready any time soon, though, and this bug is a data loss problem, so
please take the JS component route for now.
Assignee | ||
Comment 13•23 years ago
|
||
Huh, I just found this: bug 99318 with this comment:
It also fixes another (albeit non-turbo-specific) problem,
that if the user chose to quit and then, say, pressed Cancel in the `Do you want
to save before existing' dialog of Composer, remaining windows didn't close.
AFAIK, if you press Cancel in a Save/Don't Save/Cancel dialog while quitting, it
stops the app from quitting. Isn't that standard behavior the world over?
Comment 14•23 years ago
|
||
Sujay or petersen - can you see if this is a regression from 6.1? The bug was
reported around the time of 6.1 ship, but not sure if it was trunk or branch at
that time. Thanks.
Assignee | ||
Comment 15•23 years ago
|
||
Assignee | ||
Comment 16•23 years ago
|
||
The patch uses the nsCloseAllWindows component from globalOverlay.js as well as
where the Quit AppleEvent is handled so we have the same logic used everywhere.
I did make the behavior what I think is standard - if you cancel from a save
changes dialog, it stops quitting.
Dan, Simon - Can you review?
Comment 17•23 years ago
|
||
Comment on attachment 50871 [details] [diff] [review]
full patch
looks good, r=pink
Attachment #50871 -
Flags: review+
Assignee | ||
Comment 18•23 years ago
|
||
Assignee | ||
Comment 19•23 years ago
|
||
The update has two things:
1) The new license - I did that to all the new files but no need posting a new
diff for that detail
2) Instead of enumerating the windows in the order they were created (wrong,
visually distracting, and non-standard), I'm now using
nsIWindowMediator::GetZOrderDOMWindowEnumerator to close them from front to back.
Dan - can you think of any strangeness that closing them front-to-back may cause?
Assignee: danm → ccarlen
Comment 20•23 years ago
|
||
You're correct, that is standard behavior. Please ensure that Composer closes
when in turbo and quitting, when you have and do not have changes to save.
Comment 21•23 years ago
|
||
Comment on attachment 50887 [details] [diff] [review]
update to full patch
sr=sfraser
In the long term, I don't like this solution; it seems wrong to have a component whose job it is to close all windows; that task should lie with appshell or something. I think, longer term, the window closing logic should move into appshell C++ code (where we close windows without asking, from C++).
Attachment #50887 -
Flags: superreview+
Assignee | ||
Comment 22•23 years ago
|
||
Simon, I agree. File a bug on me for it. I need a better way of doing this soon.
Status: NEW → ASSIGNED
Comment 23•23 years ago
|
||
(Conrad: The z-order enumerators should work fine, used in a loop closing
windows. It'll be an ugly show behind the curtain, but it should work. If not, it
should be easy to spot and shouldn't be tough to fix.)
Comment 24•23 years ago
|
||
plussing. Conrad can you ETA this?
Assignee | ||
Updated•23 years ago
|
Whiteboard: ETA 09/27
Reporter | ||
Comment 25•23 years ago
|
||
Confirming issue also occurs in the OS X 6.1 preview release.
Assignee | ||
Comment 27•23 years ago
|
||
Assignee | ||
Comment 28•23 years ago
|
||
In the last minute, I found that, since a new js component was being added, the
packages had to be updated. This convinced me that adding this component to all
platforms was wrong. This bug was only on the Mac and the js component is a
temporary measure. Just getting this thing in the build so it could be called
from globaloverlay.js meant changing 4 makefiles and packages. Yuck. The latest
patch is the same code but only used on the Mac from C++.
Assignee | ||
Updated•23 years ago
|
Attachment #50211 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #50871 -
Attachment is obsolete: true
Comment 29•23 years ago
|
||
Comment on attachment 51255 [details] [diff] [review]
smaller patch
sr=sfraser
Attachment #51255 -
Flags: superreview+
Assignee | ||
Updated•23 years ago
|
Attachment #50887 -
Attachment is obsolete: true
Comment 30•23 years ago
|
||
Comment on attachment 51255 [details] [diff] [review]
smaller patch
r=brade
Attachment #51255 -
Flags: review+
Assignee | ||
Comment 31•23 years ago
|
||
Fix checked into branch. I'll do trunk before monday.
Whiteboard: ETA 09/27, [PDT+], OSX → ETA 09/27, [PDT+], OSX, FIXED ON BRANCH
Assignee | ||
Comment 32•23 years ago
|
||
Checked into trunk this morning - bugzilla was down.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 34•23 years ago
|
||
Verified on Oct 3 trunk build (2001-10-03-21)
Status: RESOLVED → VERIFIED
Keywords: vtrunk
You need to log in
before you can comment on or make changes to this bug.
Description
•